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);
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.pdferror: no matching member function for call to 'draw'