DRAWBMP

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

Displays - draws - a bitmap that has been loaded with loadbmp or captured with getbmp to a graphics window or graphic-box control at the upper left coordinates of x and y.

Syntax

  1. #handle.ext "drawbmp name x y"

Hints

As long as a bitmap image remains in memory, it can be drawn to as many graphics windows or graphic-boxes that you wish.
This is not the same as images that are flushed and saved to a graphics segment. In that case, even with the image unloaded, you can still resize, minimize, or cover a window without the loss of the graphics.
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 using this keyword here