Reads a BMP, GIF, JPEG, PNG, TIF and other image file formats.
READIMAGE("filename", aspect)
"filename" |
- |
A string, the filename or URL of the image file. |
aspect |
- |
Optional. In integer, the image aspect ratio. Defaults to -1, preserve image natural aspect ratio. |
An array.
W1: readimage(gethome + "data\mandrill.bmp")
W2: readimage(gethome + "data\logo.gif")
W3: readimage(gethome + "data\kasha.jpg");scalesoff
W4: readimage("https://science.nasa.gov/wp-content/uploads/2023/07/saturn-1.jpg")
W1 reads and displays the bitmap file "mandrill.bmp" in the aspect ratio of the image.

W2 reads and displays the GIF file "logo.gif" in the aspect ratio of the image.

W3 reads and displays the JPEG file "kasha.jpg", in the aspect ratio of the image and the scales are removed.

W4 reads an image of the planet Saturn directly from the internet.

The images are automatically converted to an internal RGBIMAGE (i.e. 24 bit RGB image).
The type of image is determined by the filename extension. Supported extensions include BMP, GIF, JPG, PNG and TIF. See SAVEIMAGE for a current list of supported formats.
READIMAGE supports loading of images directly from a URL.
The default aspect value of -1 causes the window aspect ratio to match the aspect ratio of the contained image. See SETASPECT for more details on the aspect ratio.