Algorithmic Solutions > LEDA > LEDA Guide > Windows and Panels > Pixrects (Pixmaps) > Example

Example Pixrects (Pixmaps)

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;
}	
Picture of Convex Hull
 

See also:

Pixrects (Pixmaps)

Windows and Panels

Basic Data Types for 2D Geometry

Input and Output Operators

Example of xpm Data String


Manual Pages:

Manual Page Windows




Please send any suggestions, comments or questions to leda@algorithmic-solutions.com
© Copyright 2001-2003, Algorithmic Solutions Software GmbH