Liberty BASIC Help Online

LOADBMP
 
LOADBMP "name", "filename.bmp"
and
LOADBMP "name", hbmp
 
Description:
The first version of this command loads a standard Windows *.BMP bitmap file on disk into Liberty BASIC.  The "name" is a string chosen to describe the bitmap being loaded and the "filename.bmp" is the actual name of the bitmap disk file.  Once loaded, the bitmap can then be displayed in a graphics window type using the DRAWBMP command (see Graphics Window Commands).
 
Usage:
  loadbmp "copyimage", "bmp\copy.bmp"
  open "Drawbmp Test" for graphics as #main
  print #main, "drawbmp copyimage 10 10"
  wait
 
  'when program exits:
  unloadbmp("copyimage")
 
The second version of the command loads the bitmap whose handle is referenced by "hbmp"This handle can be obtained from an add-on DLL that loads images, such as the nviewlib.dll, or by creating a bitmap using API calls, or by loading a bitmap with the API function LoadImageA.  Add-on DLLs allow you to access images in other formats, such as jpg or gif, and then load them with the LOADBMP command so that they can be displayed with the DRAWBMP command.
 
Usage:
 
open "NViewLib.dll"for DLL as #nv
 
file$="test.jpg"
 
calldll #nv, "NViewLibLoad",_
file$ AS ptr,1 as short,_ 
hImage AS short 'handle of loaded image
 
close #nv
 
loadbmp "newimage", hImage
open "Drawbmp Test" for graphics as #main
print #main, "drawbmp newimage 10 10"
wait
 
'when program exits:
unloadbmp("newimage")
 
 
See also:  BMPSAVE, UNLOADBMP
 


Copyright (C) 2003 Shoptalk Systems
Liberty BASIC - http://www.libertybasic.com/