skip to main content

Library Routines : W$SAVE_IMAGE

W$SAVE_IMAGE
The W$SAVE_IMAGE routine saves the image pointed by a bitmap handle into a regular disk file. The save process allows to convert the image to a different format and set some attributes like quality and transparency.
Syntax:
 CALL "W$SAVE_IMAGE" USING bitmapHandle
Parameters:
01 wsave-options.
   03 wsave-format pic x(1).  
      88 wsave-png values "P"" ".
      88 wsave-bmp value  "B".
      88 wsave-gif value  "G".
      88 wsave-jpg value  "J".
   03 wsave-other.
      05 wsave-quality pic 9(10comp-x.
      05 wsave-transparency redefines wsave-quality.
         07 filler pic 9(1comp-x.
            88 no-transparency value 0 false 1.
         07 wsave-transparent-color pic 9(9comp-x.
   03 wsave-client-server pic x.
      88 wsave-server values "S"" ".
      88 wsave-client value  "C".
Activates the transparency and identifies the RGB of the transparent color. wsave-transparent-color can be calculated as follows: (RED * 65536) + (GREEN * 256) + BLUE. It’s evaluated only for the PNG and GIF formats.
Return code:
returnCode can be any numeric data item and provides additional information:
Example:
Example - Load a BMP file and save it as JPG
copy "isgui.def".
copy "iscobol.def".
77 hbmp handle.
     call "w$bitmap" using wbitmap-load, "src.bmp"giving hbmp.
     initialize wsave-options.
     set wsave-jpg to true.
     move 75 to wsave-quality.
     call "w$save_image" using hbmp, "dest.jpg", wsave-options.
     goback.

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