Page 1 of 1
Save Window contents to BMP
Posted: Sat Mar 31, 2007 1:28 am
by Jeff Barnes
Hi Everybody,
I need to save the contents of a window to a bmp file.
I tried oWnd:SaveToBmp( cFile ) but it also copies the boarder.
Is there any function to copy only what is inside the window?
Thanks,
Jeff
Posted: Sat Mar 31, 2007 9:03 am
by Antonio Linares
Jeff,
Class TWindow Method SaveToBmp() calls the function WndBitmap().
If you modify WndBitmap() to call GetDC() instead of GetWindowDC(), then it will just save the window contents, without the caption and borders.
We could modify Method SaveToBmp() adding a new parameter:
Method SaveToBmp( cBmpFile, lBorder ) where lBorder may be .T. by default
Posted: Sat Mar 31, 2007 8:50 pm
by Jeff Barnes
Thanks Antonio.
What is the correct procedure to recompile the WndPrint.c file so I can link it into my app?
Thanks,
Jeff
(xHarb, FWH, Borland complier)
Posted: Sat Mar 31, 2007 9:03 pm
by Antonio Linares
Jeff,
First call tools\clp2harb.exe module.c modified.c
then
bcc32 -c -Ic:\harbour\include;c:\fwh\include -D__HARBOUR__ -D__FLAT__ modified.c
that will provide you a modified.obj
Posted: Sun Apr 01, 2007 12:25 am
by Jeff Barnes
Ok, I'm almost there.
I have modified the wndprint.c file and most of the window border is gone.
There is still the Bottom and Right part of the window being copied.
Is there something I can change to remove these?
Posted: Sun Apr 01, 2007 12:39 am
by Jeff Barnes
OK ... I've got it.
I manipulated the value for rct.right and rct.bottom (basically subtracted until I found the perfect number)
All borders are now gone.
Thanks for your help,
Jeff
Posted: Sun Apr 01, 2007 5:46 am
by Antonio Linares
Jeff,
Very good

Posted: Fri Apr 06, 2007 8:25 am
by Andrés González
Jeff,
I'm interested in the changes you have done. Please could you send to me. To my email:
zalezalon@gmail.com.
This is my related message:
http://fivetechsoft.com/forums/viewtopi ... t=pantallaThanks
Posted: Fri Apr 06, 2007 10:13 pm
by Jeff Barnes
Andrés,
Sent to your private email.
Jeff