Magick++: Draw a circle

Magick++ provides a sub-class DrawableCircle that draws a circle on an image canvas. We should note the crazy design of the class.

The sub-class is called as
image.draw( DrawableCircle(originX_, originY_, perimX_, perimY_) );
This call draw a circle, center of it is located at (originX_, originY_) and its radius is sqrt( (originX-perimX_)^2+originY-perimY_)^2 ). If you would like to draw a circle of 5 pixels radius at (100,50), you should call
image.draw( DrawableCircle(100, 50, 100+5, 50) );

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s