17using namespace Magick;
19int main(
int ,
char ** argv)
28 if(getenv(
"SRCDIR") != 0)
29 srcdir = getenv(
"SRCDIR");
35 string backGround =
"xc:#CCCCCC";
38 Color border =
"#D4DCF3";
41 string buttonSize =
"120x20";
44 string buttonTexture =
"granite:";
47 string text =
"Button Text";
50 string textColor =
"red";
52#if defined(MAGICKCORE_FREETYPE_DELEGATE)
54 int fontPointSize = 16;
64 button.size( buttonSize );
67 button.read( backGround );
70 Image backgroundTexture( buttonTexture );
71 button.texture( backgroundTexture );
73#if defined(MAGICKCORE_FREETYPE_DELEGATE)
75 button.fillColor( textColor );
76 button.fontPointsize( fontPointSize );
77 if (getenv(
"MAGICK_FONT") != 0)
78 button.font(
string(getenv(
"MAGICK_FONT")));
79 button.annotate( text, CenterGravity );
83 button.borderColor( border );
84 button.frame(
"6x6+3+3" );
90 button.quantizeDither(
false);
91 button.quantizeColors(64);
95 cout <<
"Writing to \"button_out.miff\" ..." << endl;
96 button.compressType( RLECompression );
97 button.write(
"button_out.miff");
103 catch( exception &error_ )
105 cout <<
"Caught exception: " << error_.what() << endl;