Page 1 of 1

[Magick++] add Half-Transparent text

Posted: 2009-10-10T06:48:03-07:00
by kingfinn
Hi,

i want to reduce the Opacity of my Drawable Text, how do i do this?

This is what i've got so far:

Code: Select all

#include <string>
#include <iostream>
#include <Magick++.h>

using namespace std;
using namespace Magick;

int main(void)
{
try {
// Create base image (white image of 300 by 200 pixels)
Image image( Geometry(300,200), Color("black") );

// Set draw options
image.strokeColor("white"); // Outline color
image.fillColor("white"); // Fill color
image.strokeWidth(1);
image.font("");
image.fontPointsize(50);

// Draw a String
image.draw( DrawableText(50,100, "kingfinn") );


// Display the result
image.display( );
}
catch( exception &error_ )
{
cout << "Caught exception: " << error_.what() << endl;
return 1;
}

return 0;
}
Cheers

Re: [Magick++] add Half-Transparent text

Posted: 2009-11-12T10:07:54-07:00
by kingfinn
*push*

Re: [Magick++] add Half-Transparent text

Posted: 2009-11-12T13:55:38-07:00
by magick
See http://www.imagemagick.org/script/color.php. You can use rgba(), for example instead of named colors.