Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #7896
| From | JohnMartens <martens@tennishulp.info> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: Capture part of screen and save to disk (BMP/JPG) |
| Date | 2015-03-22 21:36 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <men91q$q4d$1@dont-email.me> (permalink) |
| References | <49962ac6-8b0c-4304-bf0d-d418de8206fb@googlegroups.com> <1274648c-0289-4381-89fd-f1341a8ab71e@googlegroups.com> |
Maybe this helps ?
John
METHOD ScreenDumpToFile(cFilename) CLASS Window
*
* method made by Geoff
LOCAL lSaved AS LOGIC
LOCAL hDIB AS PTR
LOCAL hDC AS PTR
LOCAL hBitmap AS PTR
LOCAL hOldBitmap AS PTR
LOCAL hMemDC AS PTR
LOCAL hWnd AS PTR
// created from multiple contributions via comp.lang.clipper.visual-objects
Default(@cFilename, "C:\Temp\Window.jpg")
hMemDC := CreateCompatibleDC(NULL)
hDC := GetDC(SELF:Handle())
hBitmap := CreateCompatibleBitmap(hDC, SELF:Size:Width,
SELF:Size:Height)
hOldBitmap := SelectObject(hMemDC, hBitmap)
ReleaseDC(hWnd,hDC)
//PRF_CLIENT is om alleen canvas te nemen
SendMessage(SELF:Handle(),WM_PRINT,DWORD(_CAST,hMemDC),PRF_NONCLIENT+PRF_CHILDREN+PRF_CLIENT+PRF_ERASEBKGND)
SelectObject(hMemDC,hOldBitmap)
hDIB := DIBCreateFromHBitmap(hBitmap)
IF hDIB != NULL_PTR
IF Instr('JPG', Upper(cFilename))
DIBSaveAsJPEG(hDIB, String2Psz(cFilename))
ELSE
DIBSaveAs(hDIB, String2Psz(cFilename))
ENDIF
lSaved := File(cFilename)
ENDIF
DeleteObject(hBitmap)
DeleteDC(hMemDC)
RETURN lSaved
paulus604@gmail.com schreef op 22-3-2015 om 21:23:
> Thanks! I studied your solution, but I'm still struggling with what I have in the memory. I asume I have (after my earlier mentioned code) some kind of bitmap in memory stored.
> How can I access that and write it to disk?
>
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Capture part of screen and save to disk (BMP/JPG) paulus604@gmail.com - 2015-03-22 08:44 -0700
Re: Capture part of screen and save to disk (BMP/JPG) JohnMartens <martens@tennishulp.info> - 2015-03-22 18:24 +0100
Re: Capture part of screen and save to disk (BMP/JPG) paulus604@gmail.com - 2015-03-22 13:23 -0700
Re: Capture part of screen and save to disk (BMP/JPG) JohnMartens <martens@tennishulp.info> - 2015-03-22 21:36 +0100
Re: Capture part of screen and save to disk (BMP/JPG) paulus604@gmail.com - 2015-03-28 10:22 -0700
csiph-web