The program generates a window
W, creates a pixrect from the xpm data file
<LEDA/pixmaps/leda_icon.xpm> and draws the pixrects
at the point point p where the left mouse button is
clicked. See also Input and Output Operators.
Finally the pixrect is destroyed.
On the right there is a screenshot of the program. Clicking on
the picture shows the window in original
size.
#include <LEDA/graphics/window.h>
#include <LEDA/geo/point.h>
#include <LEDA/graphics/pixmaps/leda_icon.xpm>
int main()
{
leda::window W(400,400);
W.display();
char * pr = W.create_pixrect(leda_icon);
leda::point p;
while (W>>p) W.put_pixrect(p,pr);
W.del_pixrect(pr);
W.screenshot("pixrect");
return 0;
}
|