How to set an opacity for a color?
Posted: 2017-03-15T13:32:46-07:00
My test code is:
But it doesn't work as semi-transparent color in this way. What do I do wrong?
I compile it with the command:
where:
Code: Select all
Magick::Image img( "images/tree.png" );
img.strokeColor( "red" );
img.fillColor( Magick::Color( 0, 255, 0, 127 ) );
img.strokeWidth( 5 );
img.draw( Magick::DrawableCircle( 300, 300, 200, 200 ) );
img.write( "images/img.png" );
I compile it with the command:
Code: Select all
g++ -Wall first.cpp -o first `Magick++-config --cppflags --cxxflags --ldflags --libs`
Code: Select all
$ Magick++-config --cppflags --cxxflags --ldflags --libs
-DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/imagemagick/7.0.5-2/include/ImageMagick-7
-DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/imagemagick/7.0.5-2/include/ImageMagick-7
-L/usr/local/Cellar/imagemagick/7.0.5-2/lib -lMagick++-7.Q16HDRI -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI
-L/usr/local/Cellar/imagemagick/7.0.5-2/lib -lMagick++-7.Q16HDRI -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI