This function loads the image file specified by path into a newly created image in the nano-X server's memory and returns the ID of the new image.
![]() | The actual image types supported by the Nano-X server depend on the image types that were compiled in at server build time. |
![]() | Filename extensions are irrelevant. The algorithm examines the magic numbers in the file's header to determine the image type. Supported image types include GIF, JPEG, Windows BMP, PNG, XPM and both ASCII and binary variants of PBM, PGM and PPM. |
![]() | The file is read from a file by the nano-X server not the nano-X client. This distinction will become more important when nano-X gains support for remote cient operation over network. When the client and server are on the same machine the distinction becomes less important, unless the path is relative. If the path is relative, it must be specified relative to the servers current working directory rather than the client's. |
Type | Name | Description |
---|---|---|
char* | path | A string containing the filename of the file to load. |
int | flags | Flags 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. |