skip to main content

Library Routines : W$BITMAP

W$BITMAP
The W$BITMAP library routine provides a number of functions to manage images. It recognizes and works with the following image formats: BMP, JPG, GIF, and PNG.
With this library routine it is possible to load and unload (release memory) images, in addition to displaying them. Dealing with too many images can be inefficient. For this reason it is preferable to work with a file known as imagelist. This is a file containing a strip of images. The bitmap is then divided into several images with the size specified and the single image can be referenced by an index representing its position in the bitmap.
The CMYK (Cyan-Magenta-Yellow-Black four inks) color model is not supported. Bitmaps including this model may fail to be loaded, display bad or not be printed correctly.
Animated GIFs are rendered differently between desktop applications and web applications (Web Direct 2.0). In the former environment only the first frame is shown while in the latter the whole animation is shown.
Syntax:
 CALL "W$BITMAP" USING opCode
Parameters:
Examples:
Example - Load a bitmap from disk and display it
 working-storage section.
 copy "isgui.def".
 77  h-bitmap                pic s9(9comp-4.
 screen section.
 01  Mask.
     03 Bmp1 
        bitmap line 2 col 2
        lines 10 cells size 21 cells
     03 Ef1
        entry-field read-only
        line 13 col 2 size 15 cells
 procedure division.
    call "w$bitmap" using wbitmap-load, "images/img.png"
    if h-bitmap < 0
       display message "W$BITMAP Error: " h-bitmap
       modify Bmp1 bitmap-handle h-bitmap
    end-if.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left