XPRINT RENDER statement

Purpose

Render an image on a host printer page.

Syntax

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

Remarks

Renders an image, loaded from a resource or a disk file, on a host printer page.  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.  If XPRINT RENDER is unsuccessful, an appropriate error is generated.

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

XPRINT ATTACH, XPRINT COPY, XPRINT STRETCH