Copy window to bmp file
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Copy window to bmp file
Hi,
Is there any way to copy a window (or part of a window) to a bmp file?
Thanks,
Jeff
Is there any way to copy a window (or part of a window) to a bmp file?
Thanks,
Jeff
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Copy window to bmp file
For the entire window you can use TWindow:SaveToBmp() method.
EMG
EMG
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
This is the method:
EMG
Code: Select all
SaveToBmp( cBmpFile ) CLASS TWindow
local hBmp := WndBitmap( ::hWnd )
local hDib := DibFromBitmap( hBmp )
DibWrite( cBmpFile, hDib )
GloBalFree( hDib )
DeleteObject( hBmp )
return ( File( cBmpFile ) )
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
- RAMESHBABU
- Posts: 591
- Joined: Fri Oct 21, 2005 5:54 am
- Location: Secunderabad (T.S), India
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
This is a working sample:
EMG
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
DEFINE DIALOG oDlg
@ 0, 1 BUTTON "Save BMP" ACTION oDlg:SaveToBmp( "SAVED.BMP" )
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
- RAMESHBABU
- Posts: 591
- Joined: Fri Oct 21, 2005 5:54 am
- Location: Secunderabad (T.S), India
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- RAMESHBABU
- Posts: 591
- Joined: Fri Oct 21, 2005 5:54 am
- Location: Secunderabad (T.S), India
- RAMESHBABU
- Posts: 591
- Joined: Fri Oct 21, 2005 5:54 am
- Location: Secunderabad (T.S), India
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: