Anthony Thyssen skrev:

| I want to rotate an image using Magick++ and I want the
| background color (for the parts that are filled in by the rotation)
| to have some alpha value.
| | // g++ `Magick++-config --cppflags --cxxflags --ldflags --libs` test.cc
| #include <Magick++.h>
| | using namespace Magick; | | int
| main (int argc,
|       char **argv)
| {
|   Image im;
|   Color c (0xffff, 0, 0xffff, 0x8888);
| | im.read ("cat.jpg"); // change to some image you have
|   im.matte(true);
|   im.backgroundColor (c);
|   im.rotate(20);
|   im.write ("out.png");
| | return 0;
| }
| You should be able to set a color with a 'matte' value (0 = opaque,
MaxRGB for transparent.  Not sure of the syntax for Magick++

On the command line you can use...

     -background '#FFFF8880'

Yes, that's what I thought I did with the last value in the color value.

As I said, I got it to work using the MagickWand API (and also from the command line client). But not yet using Magick++. I'm sure there is some small stupid thing that need to be added to my program, but what?

/Dennis
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to