25using namespace Magick;
27int main(
int ,
char ** argv)
31 InitializeMagick(*argv);
36 if(getenv(
"SRCDIR") != 0)
37 srcdir = getenv(
"SRCDIR");
38 const char *
const p = getenv(
"MAGICK_FONT");
39 const string MAGICK_FONT(p ? p :
"");
45 list<Image> animation;
49 base.strokeColor(
"#600");
50 base.fillColor(
Color());
54 base.density(
Point(72,72) );
55 base.strokeColor(
Color());
56 base.fillColor(
"#600");
57 base.fontPointsize( 30 );
58 base.font( MAGICK_FONT );
59 base.boxColor(
"red" );
60 base.animationDelay( 20 );
61 base.compressType( RLECompression );
63 for (
int angle = 0; angle < 360; angle += 30 )
65 cout <<
"angle " << angle << endl;
67 pic.annotate(
"NorthWest",
Geometry(0,0,x,y), NorthWestGravity, angle );
68 pic.annotate(
"North",
Geometry(0,0,0,y), NorthGravity, angle );
69 pic.annotate(
"NorthEast",
Geometry(0,0,x,y), NorthEastGravity, angle );
70 pic.annotate(
"East",
Geometry(0,0,x,0), EastGravity, angle );
71 pic.annotate(
"Center",
Geometry(0,0,0,0), CenterGravity, angle );
72 pic.annotate(
"SouthEast",
Geometry(0,0,x,y), SouthEastGravity, angle );
73 pic.annotate(
"South",
Geometry(0,0,0,y), SouthGravity, angle );
74 pic.annotate(
"SouthWest",
Geometry(0,0,x,y), SouthWestGravity, angle );
75 pic.annotate(
"West",
Geometry(0,0,x,0), WestGravity, angle );
76 animation.push_back( pic );
78 cout <<
"Writing image \"gravity_out.miff\" ..." << endl;
79 writeImages( animation.begin(), animation.end(),
"gravity_out.miff" );
83 catch( exception &error_ )
85 cout <<
"Caught exception: " << error_.what() << endl;