BB___GETBMP

=GETBMP= toc

Description
> Copies the graphics from a graphics window or graphicbox control and makes them into a bitmap. This bitmap resides in memory.

Syntax

 * //**name**// an alias you give the bmp for indentification.
 * //**x y**// the coordinates of the upper left corner where to begin the capture.
 * //**width height**// the width and height in pixels of the area to be copied.
 * //**width height**// the width and height in pixels of the area to be copied.

Hints
> Once you use, you can use to display it to a window; or, you can use  to save the image to disk. > To retain the displayed graphics in a window, be sure to flush the graphics. > When the copied image is no longer needed, use to remove the image from memory.

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

Example
code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

open "Getbmp 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 bmpsave, 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