How to capture a form's image? The form is a child form of MDI form
Posted on 2004-10-08
I have troubles to capture a form's image (the form got all kinds of controls on it, e.g. textbox, line, shapes etc). I need capture the image of the form (how it looks like) and save it into a BMP file or JPEG file. Another hurdle is this form is a child form of a MDI form. The MDI form got menu on it. I want to capture the child form's whole image even though I can only see a part of the form.
I tried to use CaptureForm(frm1) to do it. The problem I encountered is since the function can only capture the part of the form which can be seen from the screen (the MDI Form cover other part of the form). So I have to copy all the controls to another form, then display the form as full-screen image and capture its image at that point, which is kind of dumb.
Wish some smart sample code from you!
Thanks a lot for your help.