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

Pixrects (Pixmaps)

A pixrect (pixmap) is a rectangle of pixels of a certain height and width. Each pixel has a color value. There are operations to copy a pixrect into a rectangle of the drawing area of a window.

Constructing and Deleting Pixrects

Pixrects can be constructed from rectangles of the drawing area and from external representations of pictures stored in xpm files or xpm data strings.

Example of Convex Hull

Example of Using Pixrects

Example of an xpm data string

Pixrects and bitmaps are realized by pointers of type char *. There is no constructor and no destructor. The user must explicitely create and destroy pixrects.

  char * W.create_pixrect(double x0,double y1,double x1,double y1);
  char * W.get_window_pixrect();
  char * W.create_pixrect(char ** xpm);
  char * W.create_pixrect(string prect);

The first variant constructs a pixrect from the rectangle (x0,y0,x1,y1) of the drawing area of window W and the second constructs a pixrect from the complete window. The third and fourth variant create a pixrect from an xpm data string stored as char **, respectively, string. The operation

  void W.del_pixrect(char * prect);

deletes the pixrect prect.

Drawing Pixrects

The operations
  W.put_pixrect(double x, double y, char* prect);
  W.put_pixrect(point p, char* prect);

draw the pixrect prect at the corresponding position of the drawing area of W.

See also:

Bitmaps

Colors

Windows and Panels

Input and Output Operators

Geometry


Manual Pages:

Manual Page Windows




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