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!
Last edited by Jim Davis; Nov 24th, 2008 at 05:24 PM.
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
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.
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
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.