OK, I have this program that can take the desktop and shove it into a HBITMAP. Now I'm stuck, I want to save this as a PNG but I don't know how.
I've heard that GDI+ can help me out here, can anyone give me any pointers?
Windows GDI Programming
- AndrewAPrice
- Member
- Posts: 2299
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Windows GDI Programming
Scroll down this article a bit: http://www.codeproject.com/cpp/Desktop_Calendar.asppcmattman wrote:OK, I have this program that can take the desktop and shove it into a HBITMAP. Now I'm stuck, I want to save this as a PNG but I don't know how.
I've heard that GDI+ can help me out here, can anyone give me any pointers?
Then use paint, Photoshop, the Gimp, or Paint .Net to export it as a PNG.
My OS is Perception.
Well if you have the handle of the bitmap in the HBITMAP, then you can convert it into a PNG in two ways:
1) If you know the format of PNG images, you can simply use the GetDIBits() Win32 API defined in the GDI32.dll file in order to retrieve the BITMAP image and then convert it to a PNG.
2) Download third party components or find source codes in your chosen programming language in here
You can also get a good feedback in AsmCommunity.
I hope that helped. Good luck.
1) If you know the format of PNG images, you can simply use the GetDIBits() Win32 API defined in the GDI32.dll file in order to retrieve the BITMAP image and then convert it to a PNG.
2) Download third party components or find source codes in your chosen programming language in here
You can also get a good feedback in AsmCommunity.
I hope that helped. Good luck.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.