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

Canvas_BitmapLoadImageFile

Previous pageReturn to chapter overviewNext page

 

Description

 

Create a memory bitmap and load an image file into it.

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

 

Syntax

 

hBmp = Canvas_BitmapLoadImageFile(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 image image to load.

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

Width

Number

No

Image 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

Image 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

%TRUE or %FALSE to perfome an image stretching

 

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 image, in pixels. If either of the size parameters are zero (0), the image is loaded at its natural size. If either of the size parameters is different from the natural size, the image 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