Page 1 of 1

How to draw a list of Drawables?

Posted: 2017-03-14T16:03:08-07:00
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

Re: How to draw a list of Drawables?

Posted: 2017-03-14T17:45:07-07:00
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.