Re: XForms: Load a PGM image using a canvas

Steve Lamont (
Mon, 9 Feb 98 10:43:36 PST

# To subscribers of the xforms list from (Steve Lamont) :

> Could anyone tell me how to display an image (PGM) in a canvas with the
> correct colormap???

The easiest way is to use OpenGL or MesaGL and a glCanvas object.
They'll handle the colormap conversion for you. Otherwise, you'll
have to handle the color quantization and colormap conversion
yourself. There's a nifty octree algorithm written up in the first of
the _Graphics Gems_ series to do the quantization. Refer to your
favorite Xlib reference or programming manual for a discussion of how
to handle colormaps and conversion.

To unsubscribe, send the message "unsubscribe" to or see
XForms Home Page:
List Archive: