BB___BMPSAVE

=BMPSAVE= toc

Description
> Saves a bitmap to disk.

Hints
> The bitmap to save can be one that is loaded with or captured with.
 * //**A Gotcha.**// The bitmap is saved to disk using the bit depth (bits per pixel - BPP) of the user's display setting. Have in mind that other users might have another BPP (32 vs 24 for example). It will matter if you are reading them back as binary data.

These commands are generally used when working with bitmaps: loadbmp unloadbmp drawbmp getbmp bmpsave

Example
code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

open "Bmpsave Test" for graphics_nf_nsb as #g #g "trapclose [quit]"

'fill background with color #g "fill cyan" 'print some text #g "font arial 36" #g "down;color lightgray;backcolor cyan; place 20 150" #g "\DO NOT COPY" 'capture the displayed image with alias 'noCopy' #g "getbmp noCopy 0 0 390 270" 'save image to disk as bmp file bmpsave "noCopy", "nocopy.bmp" wait

[quit] 'remove image from memory unloadbmp "noCopy" close #g end code

Useful Functions
With getbmp, this function allows to read color of a point in graphicbox / graphic window: function GetPixelValue$(x, y, handle$) code format="lb" Place a useful function using this keyword here code