16using namespace Magick;
18int main(
int ,
char ** argv)
22 InitializeMagick(*argv);
27 if(getenv(
"SRCDIR") != 0)
28 srcdir = getenv(
"SRCDIR");
34 string backGround =
"xc:#CCCCCC";
37 Color border =
"#D4DCF3";
40 string buttonSize =
"120x20";
43 string buttonTexture =
"granite:";
46 string text =
"Button Text";
49 string textColor =
"red";
51#if defined(MAGICKCORE_FREETYPE_DELEGATE)
53 int fontPointSize = 16;
63 button.size( buttonSize );
66 button.read( backGround );
69 Image backgroundTexture( buttonTexture );
70 button.texture( backgroundTexture );
72#if defined(MAGICKCORE_FREETYPE_DELEGATE)
74 button.fillColor( textColor );
75 button.fontPointsize( fontPointSize );
76 if (getenv(
"MAGICK_FONT") != 0)
77 button.font(
string(getenv(
"MAGICK_FONT")));
78 button.annotate( text, CenterGravity );
82 button.borderColor( border );
83 button.frame(
"6x6+3+3" );
89 button.quantizeDither(
false);
90 button.quantizeColors(64);
94 cout <<
"Writing to \"button_out.miff\" ..." << endl;
95 button.compressType( RLECompression );
96 button.write(
"button_out.miff");
102 catch( exception &error_ )
104 cout <<
"Caught exception: " << error_.what() << endl;