VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Screenshot Without Using Clipboard Or DIB

DanDaMan  (2 Submissions)   Graphics   Intermediate   Wed 3rd February 2021

Seen many posts using api for printscreen keypress, but what about the info on clipboard? Seen others that copy clipboard to temp var, and set back after, but why waste resources and processing when you can do it the right way? Also seen classes using DIB, wayyy slow. This = best way! =D
This uses two tricks that arent very known, so here you go! When using GetDC(0) as our source, we actually capture the screen, and when using picture.image=picture.picture.

Assumes
Always make sure the Picturebox has AutoRedraw enabled. Create a Command1, and in it call ScreenShot()

Returns
A screenshot in the app folder called screenshot.bmp

API Declarations
Bitblt and GetDC

Rate Screenshot Without Using Clipboard Or DIB (8(8 Vote))
Screenshot Without Using Clipboard Or DIB.bas

Screenshot Without Using Clipboard Or DIB Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters