Results 1 to 6 of 6

Thread: Form-Shot

  1. #1

    Thread Starter
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Form-Shot

    Hello!

    I've just play around how to take a shot of a form. Well its just takes a partial shot from the screendc. As long as your form can fit in the screen this takes the shot as well. I have extended it to work on your local form /CaptureME()/, but you can take a shot of any app /Capture_hWnd/, you just have to set the target form's hWnd. It saves the output to a bmp file. Its not the best solution, but its simple, smart and beautiful

    Have fun!
    Attached Files Attached Files
    Last edited by Jim Davis; Nov 24th, 2008 at 05:24 PM.

  2. #2

    Thread Starter
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: Form-Shot

    I've been extended my example, with a new method.

    Function CaptureFormArea(frm As Form)

    You can take a shot of the form's "client area", but without the borders and titlebar.

    kapshure_form-2.zip

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Form-Shot

    some issue with this function as it always captures the same image, even if the controls are changed
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  4. #4

    Thread Starter
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: Form-Shot

    Thanks for your reporting! Its not a real issue, but i just didn't included a Clipboard.Clear before assigning the image, that is the reason the clipboard will not be updated.

    Post updated.
    kapshure_form-4.zip
    Last edited by Jim Davis; Nov 24th, 2008 at 05:25 PM.

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Form-Shot

    glad it was so simple
    i would have thought that the new data would have overwritten the clipboard content anyway, but obviously not
    i will play with it more later
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  6. #6
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: Form-Shot

    Hi Jim,
    You are even more famous, as I reckon this is your code on VB-Helper -
    http://www.vb-helper.com/howto_delay...top_image.html

    I like that I can direct the capture to the clipboard.
    I am about to post a question to the VB6 forum to see if it is possible to build up a series of captures in the clipboard ? (ending up with a single long image in the clipboard.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width