SAVE FILE |
Save Image to Disk |
SAVE FILE (chan[,ERR=stmtref]) TO filename$
Where:
chan |
Channel or logical file number to be read from. |
filename$ |
A valid filename with one of the following extensions: .bmp, .jpg, .jpeg, .j2k or .png. |
stmtref |
Program line number or statement label to which to transfer control. |
Mandatory keyword, not case sensitive. |
Use the SAVE FILE directive to save an image written to *BITMAP* (virtual file) directly to an image file on disk with the extension .bmp, .jpg, .jpeg, .j2k or .png.
In this example, *BITMAP* is used to capture PxPlus internal bitmaps, which are then saved to .bmp files using SAVE FILE:
0010 PicList$='picture'(*)+","
0020 x=pos(","=PicList$); if x=0 then stop
0030 f$=PicList$(1,x-1),PicList$=PicList$(x+1)
0040 open (1)"*bitmap*;Width=1;Length=1"
0050 print (1)'picture'(0,0,@x(mxc(1)+1),@y(mxl(1)+1),"!"+f$,4),
0060 f$="/tmp/"+f$+".bmp"; erase f$,err=*proceed
0070 save file (1) to f$
0080 close (1)
0090 goto 0020