Screen capture

Windows specific forum
alanuk
User
User
Posts: 68
Joined: Mon Oct 13, 2003 6:38 pm

Screen capture

Post 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
GreenGiant
Enthusiast
Enthusiast
Posts: 252
Joined: Fri Feb 20, 2004 5:43 pm

Post 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.
alanuk
User
User
Posts: 68
Joined: Mon Oct 13, 2003 6:38 pm

Post 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
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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.
@}--`--,-- A rose by any other name ..
alanuk
User
User
Posts: 68
Joined: Mon Oct 13, 2003 6:38 pm

Post 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
Post Reply