GrNewPixmap()

Name

GrNewPixmap() -- Create a new pixmap

Synopsis

GR_WINDOW_ID GrNewPixmap ( GR_SIZE width , GR_SIZE height , void * addr );

Description

This function creates a new server side pixmap of the specified width and height.

Note

A pixmap is basically an offscreen window. You can draw to a pixmap just as you would an on screen window. The return value of this function is a bit misleading, in that it should probably be a GR_DRAW_ID rather than a window ID. From a drawing point of view nano-X does not make much of a difference between window IDs and drawable IDs.

Note

When finished with the pixmap, the application must free the resources allocated to the pixmap by calling the function GrDestroyWindow() with the pixmap ID as the ID of the window to destroy.

Parameters

TypeNameDescription
GR_SIZEwidthThe width in pixels of the pixmap.
GR_SIZEheightThe height in pixels of the pixmap.
void*addrOptional pointer to pixel buffer. If you have a pixel buffer already allocated for the pixmap, then pass that buffer via this parameter. If this parameter is NULL then the function will attemp to allocate a proper sized pixel buffer. If the pixel buffer is automatically allocated the buffer will automatically be freed when the pixmap is destroyed using GrDestroyWindow().

Returns

The ID of the newly created pixmap.

See Also

GrNewPixmapFromData(), GrDestroyWindow(), GrCopyArea(), GrSetBackgroundPixmap().