[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 GBMPLOAD()
 Load a bitmap (.bmp) or icon (.ico) file into memory
------------------------------------------------------------------------------
 Syntax

     GBMPLOAD(<cFileName>) --> aBmpArray

 Arguments

     <cFileName> is a character value that specifies the name of .bmp or
     .ico file to load into VMM memory.

 Returns

     GBMPLOAD() returns a reference to <aBmpArray> which is the pointer to
     the VMM region containing the .BMP or .ICO (not a black and white icon).
     The first two elements of <aBmpArray> contain the height and width of
     the .BMP or .ICO in pixels.  Do not modify this array before passing it
     to GBMPDISP().  The following table shows the array structure:

     aBmpArray Structure
     ------------------------------------------------------------------------
     Array Position    Return Value
     ------------------------------------------------------------------------
     LLG_BMP_X         Returns size on the X axis
     LLG_BMP_Y         Returns size on the Y axis
     ------------------------------------------------------------------------

     The size and elements of this array should never be changed.

 Description

     GBMPLOAD() allows you to load one or more .BMP or .ICO files into memory
     without having to display them.  This function is useful when you want
     to load a group of small .BMP files which are used often in an
     application (e.g., buttons).  It avoids having to load the .BMP file
     each time you display it.

     Warning!  It is not a good idea to keep backgrounds or images in
     memory unless you have a great deal of memory.  This also includes any
     variable pointing to the variables which contain the .BMP.

 Notes

     When a .BMP or .ICO is stored in a LOCAL variable, the memory occupied
     in the VMM is automatically freed when the function returns.  You can
     free the memory at any time by assigning NIL to the variable.  It is not
     necessary to be in graphic mode to use GBMPLOAD(), but it is necessary
     to be in graphic mode before calling GBMPDISP().

 Examples

     .  This example stores all the buttons used by an application in
        an array:

        STATIC aIcons:= {}
        AADD(aIcons, GBMPLOAD('ARROW_U.BMP'))
        AADD(aIcons, GBMPLOAD('ARROW_D.BMP'))
        AADD(aIcons, GBMPLOAD('ARROW_L.BMP'))
        AADD(aIcons, GBMPLOAD('ARROW_R.BMP'))
        // Set video to graphic mode
        SET VIDEOMODE TO LLG_VIDEO_VGA_640_480_16
        // Display the ARROW_U.BMP
        GBMPDISP(aIcons[1], 100, 200)

 Files   Library is LLIBG.LIB, header file is Llibg.ch.


See Also: GBMPDISP() GMODE() GSETPAL() GWRITEAT()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson