How to get bimap of a form
-
I want to display the bitmap of an active form, in a MDI app, in a picture box. The picture box control is on the MDI form, whenever user changes the current active form, the picture box control should show the picture of the active form. I want to know how do I get the picture of the active form. One method I can think of is: 1. Get the Graphics object of the active form 2. Get the HDC from the graphics object 3. Create a blank bitmap of the same size as the size of the form. 3. Use Win32 function BitBlt and copy the pixel data from the form's hdc to the bitmap's hdc. Save the bitmap to a file and show the file in the picture box. Is there any other (simpler) way to do this? Thanks suhas
-
I want to display the bitmap of an active form, in a MDI app, in a picture box. The picture box control is on the MDI form, whenever user changes the current active form, the picture box control should show the picture of the active form. I want to know how do I get the picture of the active form. One method I can think of is: 1. Get the Graphics object of the active form 2. Get the HDC from the graphics object 3. Create a blank bitmap of the same size as the size of the form. 3. Use Win32 function BitBlt and copy the pixel data from the form's hdc to the bitmap's hdc. Save the bitmap to a file and show the file in the picture box. Is there any other (simpler) way to do this? Thanks suhas
-
i did it that way above. I really dont know of a easyier way to do it though, either way its easy to do it above. the codeproject has a class that someone wrote that has all the api work done for your. Jesse M The Code Project Is Your Friend...