[EMAIL PROTECTED] on wrote...
| 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.
|
| I wrote the following program but it only fill in the new areas using the
| color without the alpha value. When I do a similar program using the wand
| api I get the result that I want. What did I do wrong in my Magick++
| program?
|
| /Dennis
|
| // 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'
The last two hex values is the matte value for the color.
Anthony Thyssen ( System Programmer ) <[EMAIL PROTECTED]>
-----------------------------------------------------------------------------
"Around here we've got a name for people what talks to dragons."
"Traitor?" Wiz asked apprehensively.
"No. Lunch." -- Rick Cook, "Wizadry Consulted"
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users