Evan Carslake
Evan Carslake

Reputation: 2359

Drawing to a GDI+ Bitmap

I am trying to move everything from GDI to GDI+. As it stands I am drawing to a buffer DC (GDI). I am wanting to have it instead drawn to a HBITMAP and only have it drawn once. I have tried things with pointers and Image, but could not find anything useful. There is no istream or file, and I am not using the flat api version (found a constructor for that.)

http://pastebin.com/bcw07Suq

Upvotes: -3

Views: 1819

Answers (1)

Evan Carslake
Evan Carslake

Reputation: 2359

Solved. Here is how you can create the bitmap and then proceed to draw.

Graphics g(hDC);
Bitmap foobar(100,100,PixelFormat32bppPARGB);
g.DrawImage(&foobar,100,100);
SolidBrush brush(Color::Blue);
g.FillRectangle(&brush, 0,0,10,10);

Upvotes: -1

Related Questions