This source file includes following definitions.
- main
#include <Magick++.h>
#include <string>
#include <iostream>
using namespace std;
using namespace Magick;
int main( int , char ** argv)
{
InitializeMagick(*argv);
try {
string srcdir("");
if(getenv("SRCDIR") != 0)
srcdir = getenv("SRCDIR");
Image image( "300x300", "white" );
std::list<Coordinate> poly_coord;
poly_coord.push_back( Coordinate(30,30) );
poly_coord.push_back( Coordinate(100,10) );
poly_coord.push_back( Coordinate(190,290) );
poly_coord.push_back( Coordinate(30,290) );
Image texture( srcdir + "tile.miff" );
image.penTexture( texture );
image.draw( DrawablePolygon( poly_coord ) );
texture.isValid( false );
image.penTexture( texture );
image.strokeColor( "black" );
image.fillColor( "red" );
image.strokeWidth( 5 );
image.draw( DrawableEllipse( 100,100, 50,75, 0,360 ) );
image.fillColor( Color() );
image.strokeColor( "black" );
image.strokeWidth( 5 );
list<Drawable> drawlist;
poly_coord.clear();
poly_coord.push_back( Coordinate(30,30) );
poly_coord.push_back( Coordinate(100,10) );
poly_coord.push_back( Coordinate(190,290) );
poly_coord.push_back( Coordinate(30,290) );
drawlist.push_back( DrawablePolygon( poly_coord ) );
image.draw( drawlist );
image.colorFuzz( 0.5*QuantumRange );
image.floodFillColor( "+132+62", "blue" );
image.strokeColor(Color());
image.fillColor( "red" );
image.fontPointsize( 18 );
image.annotate( "Hello world!", "+150+20" );
image.fillColor( "blue" );
image.fontPointsize( 14 );
image.annotate( "Goodbye cruel world!", "+150+38" );
image.fillColor( "black" );
image.fontPointsize( 14 );
image.annotate( "I'm climbing the wall!", "+280+120",
NorthWestGravity, 90.0 );
cout << "Writing image \"shapes_out.miff\" ..." << endl;
image.depth( 8 );
image.compressType( RLECompression );
image.write( "shapes_out.miff" );
}
catch( exception &error_ )
{
cout << "Caught exception: " << error_.what() << endl;
return 1;
}
return 0;
}