Screen Capturing Routines

This is a multi-purpose selection of screen capturing routines.

You can use it to capture a passed in VB Form or any window with a specified HWND. For example, you could use the GetDeskTopWindow to get the Desk Top HWND and then capture the whole desktop to a VB Picture Object.

Screen Shot

Perhaps the best thing about these routines are that they return a standard VB Picture Object. That means that you can incorporate screen capturing routines for many different purposes (and save them to disk with the SavePicture vb statement) - for instance, if your program raises an error, you can capture the screen in your error handling routine and then save it to disk / database / whatever ! - You could even email the saved picture straight to the relevant developer.

Example usage :


'
  set Picture1.Picture = CaptureForm(me)
  PrintPicture Printer, Picture2.Picture
  Printer.EndDoc
'
' or :
'
  Dim oPic as StdPicture

  set oPic = CaptureWindow(0, 0, 0, _
        Screen.Width / Screen.TwipsPerPixelX, _
        Screen.Height / Screen.TwipsPerPixelY)
'
  SavePicture oPic.Picture, "c:\output.bmp"
'

Download Zipped Project and ScreenCapture.BAS module (5k)



Comments

  • Same program in SDK

    Posted by pajaiswal on 09/05/2007 03:00am

    can you tell the same program in SDK.

    Reply
  • screen capturing

    Posted by Legacy on 02/20/2004 12:00am

    Originally posted by: Ramkisaur Prajapat

    sir this rutine is better
    
    but i want the rutine for desktop capturing System
    implementation in c/c++
    thankyou
    by

    Reply
  • urgent help needed

    Posted by Legacy on 05/28/2003 12:00am

    Originally posted by: Prakriti


    THE ABOVE CODE WORKS WELL FOR CAPTURING THE SCREEN
    IMAGE but i too
    WANT TO SEND THE CAPTURED PICTURE (STDPICTURE OBJECT)
    TO ANOTHER MACHINE WITHOUT SAVING IT AS A FILE
    USING WINSOCK CONTROL IN VISUAL BASIC.

    ANY IDEA ON THE ABOVE QUESTION.

    PLEASE SEND TO ME IN THE EMAIL ADDRESS
    prakriti_s@yahoo.com

    Reply
  • THIS WORKS WELL BUT I WANT SOMETHING MORE

    Posted by Legacy on 06/04/2002 12:00am

    Originally posted by: LIJU JOHN

    THE ABOVE CODE WORKS WELL FOR CAPTURING THE SCREEN
    IMAGE AND IT CAN SEEN IN OUR MACHINE.

    I WANT TO SEND THE CAPTURED PICTURE (STDPICTURE OBJECT)
    TO ANOTHER MACHINE WITHOUT SAVING IT AS A FILE
    USING WINSOCK CONTROL IN VISUAL BASIC.

    ANY IDEA ON THE ABOVE QUESTION.

    PLEASE SEND TO ME IN THE EMAIL ADDRESS
    LIJU_JOHN@YAHOO.COM

    Reply
  • Creating images with text

    Posted by Legacy on 05/17/2000 12:00am

    Originally posted by: Kart

    I want to create/save an image which is a combination of another image and user-inputted text.
    
    

    So the end result will be like a customized jpg/gif image-button with the text on top of another image.

    Can I do this?

    regards and thanks,
    Kart

    Reply
  • Save option

    Posted by Legacy on 01/31/2000 12:00am

    Originally posted by: Alex

    How can I reduce the colour depth of the bitmap before I save it? The idea is to reduce the size of the file. Or can I convert it to jpg?
    Thanx.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: November 20, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT Are you wanting to target two or more platforms such as iOS, Android, and/or Windows? You are not alone. 90% of enterprises today are targeting two or more platforms. Attend this eSeminar to discover how mobile app developers can rely on one IDE to create applications across platforms and approaches (web, native, and/or hybrid), saving time, money, and effort and introducing apps to market faster. You'll learn the trade-offs for gaining long …

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds