How do I use gravity with DrawableText?

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
octopus
Posts: 2
Joined: 2013-11-07T15:51:16-07:00
Authentication code: 6789

How do I use gravity with DrawableText?

Post by octopus »

I am trying to place text at the bottom of an image I have called 'desktop'. The following code does not put it where I want. How can I fix it?

Code: Select all

  list<Magick::Drawable> drawList;
  drawList.push_back( Magick::DrawableGravity(Magick::SouthGravity) );
  drawList.push_back( Magick::DrawableFillColor("black") );
  drawList.push_back( Magick::DrawableStrokeColor("black") );
  drawList.push_back( Magick::DrawableFont(fontface) );
  drawList.push_back( Magick::DrawablePointSize(30) );
  drawList.push_back( Magick::DrawableText(0.5*pContext->width,pContext->height-50,text) );
  desktop.draw( drawList );
Post Reply