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