skip to main content

Controls Reference : BITMAP : Properties : Transparent-Color

Transparent-Color
isCOBOL automatically recognizes transparent colors or alpha channel in images that store such information (.gif, .png). For this reason this property should be used when it is necessary to have transparency with images stored in a format that does not contain transparency information. In this case, the RGB color set here is interpreted as "transparent" and all the pixels of the image containing this color are not displayed.
The RGB color value is computed according to the following formula:
 
Example - Define a bitmap in screen section that uses an image having yellow brackground (not transparent background) and make that background to be transparent
working-storage section.
77 img-bmp         pic s9(9comp-4.
77 yellow-color    pic 9(9).
screen section.
  03 bitmap
     line 2.0col 2.0
     lines 128.0size 128.0
     transparent-color yellow-color
     bitmap-handle img-bmp
     bitmap-number 1
procedure division.
     |the yellow RGB is #FFFF00 (255, 255, 0)
     compute yellow-color = (255 * 65536) + (255 * 256) + 0.
     call "w$bitmap" using wbitmap-load, "img.bmp"

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