Save Client Area as Image
-
I think this is very Simple Question but I am new babie :-O . In the SDI application. I draw something on the client area. I want to save this as a BMP and some other formats(GIF, JPEG . . .). So that this image can be open in any other software. My primary goal is to save it as BMP format. I want to do this without using any other's library. And also without using MFC (If possible, I hope) :confused:. Thanks in advance. Some sample code will help alot.
-
I think this is very Simple Question but I am new babie :-O . In the SDI application. I draw something on the client area. I want to save this as a BMP and some other formats(GIF, JPEG . . .). So that this image can be open in any other software. My primary goal is to save it as BMP format. I want to do this without using any other's library. And also without using MFC (If possible, I hope) :confused:. Thanks in advance. Some sample code will help alot.
Questions like this one are very difficult to give an answer to! syedhassan4 wrote: I want to do this without using any other's library. And also without using MFC (If possible, I hope) . The answer is many many lines of code and if you want an answer I think you have to take a look at some classes or something that do what you want to do and then ask here if you'll get problems when trying to do something similarly! ;) :) ;) :rose: ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------
-
Questions like this one are very difficult to give an answer to! syedhassan4 wrote: I want to do this without using any other's library. And also without using MFC (If possible, I hope) . The answer is many many lines of code and if you want an answer I think you have to take a look at some classes or something that do what you want to do and then ask here if you'll get problems when trying to do something similarly! ;) :) ;) :rose: ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------
Actually it's damn easy. Just use GetWindowDC to get a handle to the windows device context and use GDI+ to save the image. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001 Picture the daffodil. And while you do that, I'll be over here going through your stuff. Picture a world without war, without hate. And I can picture us attacking that world, because they would never expect it.
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
I think this is very Simple Question but I am new babie :-O . In the SDI application. I draw something on the client area. I want to save this as a BMP and some other formats(GIF, JPEG . . .). So that this image can be open in any other software. My primary goal is to save it as BMP format. I want to do this without using any other's library. And also without using MFC (If possible, I hope) :confused:. Thanks in advance. Some sample code will help alot.
My 'Doodle' article shows how to use GDI+ to save an image to disk in different formats, the CXImage class also on CP shows a way to do it which doesn't involve downloading the SDK or relying on a DLL. Use GetWindowDC to get a device context you can use to grab the contents of the window. Just remember to make the Image you create the same bit depth as the screen, you can use GetDeviceCaps(BITSPIXEL) on the DC you get back from GetWindowDC to figure out what you need. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001 Picture the daffodil. And while you do that, I'll be over here going through your stuff. Picture a world without war, without hate. And I can picture us attacking that world, because they would never expect it.
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now