Code: Select all
int w = 800, h = 600;
Magick::Image img5( Magick::Geometry( w, h ), Magick::Color( "white" ) );
img5.font( "ComicSans" );
img5.fontPointsize( 50 );
img5.fillColor( Magick::Color( "maroon" ) );
img5.strokeColor( Magick::Color( "red" ) );
img5.strokeWidth( 2 );
img5.textGravity( MagickCore::CenterGravity );
img5.draw( Magick::DrawableText( w / 2, h / 2, "Some text!" ) );
img5.write( "images/output.png" );
IM: 7.0.5-2 Q16 x86_64 2017-03-11