GrDrawImageFromFile()

Name

GrDrawImageFromFile() -- Draw an image from a file

Synopsis

void GrDrawImageFromFile ( GR_DRAW_ID id , GR_GC_ID gc , GR_COORD x , GR_COORD y , GR_SIZE width , GR_SIZE height , char * path , int flags );

Description

This function loads the image file specified by path and draws the image at the specified location on the drawable. Supported image types include GIF, JPEG, Windows BMP, PNG, XPM and both ASCII and binary variants of PBM, PGM and PPM.

Note

The actual image types supported by the Nano-X server depend on the image types that were compiled in at microwindows/nano-X library build time.

Note

Filename extensions are irrelevant. The algorithm examines the magic numbers in the file's header to determine the image type.

Parameters

TypeNameDescription
GR_DRAW_IDidThe ID of the drawable to draw the image onto.
GR_GC_IDgcThe ID of the graphics context to use when drawing the image.
GR_COORDxThe X coordinate to draw the image at.
GR_COORDyThe Y coordinate to draw the image at.
GR_SIZEwidthThe width to scale the image to.
GR_SIZEheightThe height to scale the image to.
char*pathA string containing the filename of the file to load.
intflagsFlags based of the specific image type. Currenly flags is only used for loading JPEG files. If set to TRUE the JPEG will be loaded in "fast grayscale" mode. If set to FALSE the image will be drawn in RGB color mode.

See Also

GrFreeImage(), GrGetImageInfo(), GrLoadImageFromFile(), GrDrawImageToFit().