How to draw a list of Drawables?

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
Airon65
Posts: 75
Joined: 2017-02-26T02:19:38-07:00
Authentication code: 1151

How to draw a list of Drawables?

Post by Airon65 »

I use ImageMagick 7.0.5, MacOSX 10.12.3. Trying to run this code:

Code: Select all

list<Drawable> objects_to_draw; // push in list the rendering objects and the
 // associated draw formatting objects
list<Coordinate> coords_of_triangle; // push in list the coordinates of a triangle
coords_of_triangle.push_back(Coordinate(0,0));
coords_of_triangle.push_back(Coordinate(20,100));
coords_of_triangle.push_back(Coordinate(40,0));
// create a triangle and “push” it in the drawable objects list
objects_to_draw.push_back(DrawablePolygon(coords_of_triangle));
// create a rectangle and “push” it in the drawable objects list
objects_to_draw.push_back(DrawableRectangle(100,100, 250,200));
// perform the actual draw on my_image (the list of objects_to_draw are drawn)
img2.draw(objects_to_draw);
I get this error:
error: no matching member function for call to 'draw'
Seems there's some problem with a list of Drawables. But why? I've found this code here: https://www.imagemagick.org/Magick++/tu ... torial.pdf
Airon65
Posts: 75
Joined: 2017-02-26T02:19:38-07:00
Authentication code: 1151

Re: How to draw a list of Drawables?

Post by Airon65 »

Ok. I've just found the issue. From 7 version of ImageMagick - now it's std::vector, not std::list. Now it works.
Post Reply