Page 1 of 1
Screen capture
Posted: Mon Aug 02, 2004 2:37 pm
by alanuk
Is it possible, or is there a way to do a screen capture of an image displayed withing PB? Maybe there is a library function that will do it?
Any help welcomed.
Alan
Posted: Mon Aug 02, 2004 3:00 pm
by GreenGiant
Not amazingly sure what you wanted, but this code should grab your whole pb window and save it as a bmp in the folder where the source/exe is.
Code: Select all
#Screenshotimage=50
sourcedc=GetDC_(WindowID())
CreateImage(#Screenshotimage,WindowWidth(),WindowHeight())
UseImage(#Screenshotimage)
destdc=StartDrawing(ImageOutput())
BitBlt_(destdc,0,0,WindowWidth(),WindowHeight(),sourcedc,0,0,#SRCCOPY)
StopDrawing()
SaveImage(#Screenshotimage,"screenshot.bmp")
If this isnt what you wanted, then maybe a few more details would be helpful.
Posted: Mon Aug 02, 2004 5:56 pm
by alanuk
GreenGiant, many thanks for your comments and code. It looks as if it can be done. I will have a closer look at the code later.
Yes, I should have been a little more expicit !
I will have an opaque image of say 100 x 100 pixels with a transparent layer of the same size on top. I want to capture both layers as if they were one, ie what the eye sees.
Hope this helps.
Alan
Posted: Mon Aug 02, 2004 9:49 pm
by Dare2
Hi alanuk,
IIRC there is something like that in the code archive on purearea.net - can't recall what it is called though. Screenshot or something. Also a magnifier that might be mod-able.
Posted: Tue Aug 03, 2004 6:37 am
by alanuk
Dare2, many thanks for your help. I did another search, with "screenshot" this time and found a lot of info just what I want to do.
Thanks guys for your help.
Alan