LOADIMAGE

Top  Previous  Next

Syntax

UINT = LOADIMAGE(identifier, type as INT)

Description

Loads an image from a file or resources and returns a handle for that image.

Parameters

identifier - Filename, resource name or resource ID to image.

type - type of image, see remarks.

Return value

Handle to the loaded image. Handle can be subsequently be used in the SHOWIMAGE, SETCURSOR or SETICON functions.

Remarks

Type is a numeric value defining what kind of image to load.

The valid values for type are:

@IMGBITMAP - bitmap (*.bmp)

@IMGICON - Icon (*.ico)

@IMGCURSOR - Cursor (*.cur)

@IMGEMF - Enhanced meta file (*.emf)

@IMGSCALABLE - scalable bitmap, JPEG (*.jpg) or GIF (*.gif) files.

If a filename is specified as the identifier then the image is loaded from disk. EBASIC can also load bitmaps, icons and cursors directly from the executables resources. Enhanced meta files cannot be loaded from the resource table. Scalable images may be loaded from resources as custom type of RTIMAGE. The resource identifier is either the string or integer identifier of a resource compiled with the project.

When done with an image use the DELETEIMAGE statement on the returned handle.

See Also: SHOWIMAGE, SETCURSOR, SETICON, DELETEIMAGE

Example usage

mybmp = LOADIMAGE(GETSTARTPATH + "picture.bmp", @IMGBITMAP)