GRAPHIC RENDER statement  

Purpose

Render an image on the selected graphic target.

Syntax

GRAPHIC RENDER BmpName$, (x1!, y1!)-(x2!, y2!)

Remarks

Renders an image, loaded from a resource or a disk file, on the selected graphic bitmap or window.  The parameter BmpName$ contains the name of an image to be loaded.  If BmpName$ contains a period, it is presumed to be the name of a disk file.  Otherwise, an attempt is made to load it from the program’s resource data; if not found, it is then presumed to be a disk file.  The parameters x1!,. y1! define the upper left corner of the destination rectangle, while x2!, y2! define the lower right corner of that rectangle. If the destination rectangle is larger or smaller than the original, the image is stretched or shrunk to the requested size.

The following code will retrieve the natural size of an image in a bitmap file, in pixels:

nFile& = FREEFILE

OPEN "myimage.bmp" FOR BINARY AS nFile&

GET #nFile&, 19, nWidth&

GET #nFile&, 23, nHeight&

CLOSE nFile&

See also

GRAPHIC ATTACH, GRAPHIC COPY, GRAPHIC STRETCH