Navigation:  ThinBASIC Modules > UI (User Interface) > Additional Controls and Functions > Canvas Control >

Canvas_BitmapLoad

Previous pageReturn to chapter overviewNext page

 

Description

 

Create a memory bitmap and load an image into it.

Image file can be one of the following type: .png .jpg .jpeg .gif .bmp .tif

 

Syntax

 

hBmp = Canvas_BitmapLoad(FileName, width, height [, Stretch])

 

Returns

 

Number

If the bitmap creation is successful, the bitmap handle is assigned to the variable hBmp.

If not successful, hBmp is set to zero.

 

Parameters

 

Name

Type

Optional

Meaning

FileName

String

No

Full path of the bitmap image to load

Width

Number

No

Bitmap width

The parameters Width and Height specify the width and height of the bitmap, in pixels. If either of the size parameters are zero (0), the bitmap is loaded at its natural size. If either of the size parameters is different from the natural size, the bitmap is stretched or condensed to the requested size

Height

Number

No

Bitmap height

The parameters Width and Height specify the width and height of the bitmap, in pixels. If either of the size parameters are zero (0), the bitmap is loaded at its natural size. If either of the size parameters is different from the natural size, the bitmap is stretched or condensed to the requested size

Stretch

Number

Yes

If present, image will be stretched.

 

Remarks

 

Creates a new memory bitmap, which may be manipulated and drawn just as if it were a Canvas Window, except that it is not visible.

 

The parameters Width and Height specify the width and height of the bitmap, in pixels. If either of the size parameters are zero (0), the bitmap is loaded at its natural size. If either of the size parameters is different from the natural size, the bitmap is stretched or condensed to the requested size

 

Use Canvas_BitmapCopy* functions (Canvas_BitmapCopy1, Canvas_BitmapCopy2, Canvas_BitmapCopy3) to copy loaded image into current attached Canvas, see Canvas_Atatch.

 

Restrictions

 

When you are finished using this memory bitmap, you must delete it with Canvas_BitmapEnd.

 

See also

 

Examples