WINDOWS
Capture window's content in a picture
I am looking for a way to grab the content of a window and save it as a PICT file.
I tried a combination that did work
Adress& = FN OpenPicture(windowRect)
FN myDrawingRoutine ' from my own stuff
FN savePictFile(Address&) ' from the library
fn ClosePicture
fn KillPicture(Address&)
Is there a less "intrusive" method that could for example the address of the imageMap of the current graphic port? Or something where i don't have to "draw into" but rather grab after the drawing has been done.
You want USR GETPICT. Set up a rect the same size as your window,and grab away.
>From FB Help...
Syntax
pictHandle& = USR GETPICT(screenRect)
Definition
Returns a handle to a picture of the portion of the screen defined by screenRect. The picture will be in the current color depth (see SYSTEM(_crntDepth)).
Example
'simple screen capture program
DIM rect.8 'rectangle record
CALL SETRECT(rect,10,10,100,100) 'capture t,l,b,r of screen
pictHndl& = USR GETPICT(rect) 'get the handle
PICTURE(0,0), pictHndl& 'put it in the window.
|