LOADBMP

From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Not supported in Run BASIC

Description

Retrieves a bitmap image stored on disk as "filename.bmp" and places it in memory. The program may then use the image by calling on its alias, "name".
Also see DRAWBMP and UNLOADBMP.

Syntax

  1. loadbmp "name", "filename.bmp"

Hints

When moving bitmaps to and from the disk, both the "name" and "filename.bmp" are required for reference.
When displaying the images within the program, refer to the "name" only. For this reason, when possible, choose a name that represents the image (such as "copyimage") so the code will be easier to follow.

These commands are generally used when working with bitmaps:

Example

    'Run this example from the main JustBASIC program folder so
    'the bmp\subfolder and bmp image are accessible.
    loadbmp "copyimage", "bmp\copy.bmp"
    open "Loadbmp Test" for graphics as #main
    #main "trapclose [quit]"

    print #main, "drawbmp copyimage 10 10; flush"

    wait

[quit]
    unloadbmp "copyimage"
    close #main
    end

Useful Procedures

' Place a useful function or sub using this keyword here