[Magick++] add Half-Transparent text

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
kingfinn

[Magick++] add Half-Transparent text

Post 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
kingfinn

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

Post by kingfinn »

*push*
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

See http://www.imagemagick.org/script/color.php. You can use rgba(), for example instead of named colors.
Post Reply