954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

[GDI+] - Saving Graphics objet

Hi to all,

i have a little problem with my little application. I create a graphic object where i draw a series of text. I create it with

Graphics gg(hdc)


where hdc in the handle context of the screen ( BeginPaint ). Now i want to save this graphics object in the png image file. I try to create a bitmap file from gg with

Bitmap *b = new (w,h,&g)


end then

b->save(L"c:\\tmp.png", &pngclsid, NULL)


, but don't work...

Anyone have the solution?

Thanks lot

welcomepro
Newbie Poster
7 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

Hi to all,

i have a little problem with my little application. I create a graphic object where i draw a series of text. I create it with

Graphics gg(hdc)

where hdc in the handle context of the screen ( BeginPaint ). Now i want to save this graphics object in the png image file. I try to create a bitmap file from gg with

Bitmap *b = new (w,h,&g)

end then

b->save(L"c:\\tmp.png", &pngclsid, NULL)

, but don't work...

Anyone have the solution?

Thanks lot

The problem is the dimension of the BMP, but now, the file is saved but empty...

welcomepro
Newbie Poster
7 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: