How to get HBITMAP from Graphics object in Gdiplus?

J

james

HBITMAP is one of GDI object in CDC, So you need to use SelectObject to
select HBITMAP object into CDC before you draw.
 
A

AD

Hey,
I have a problem with getting a bitmap (HBITMAP) from Device Context using
Graphics object.
Let's say I draw something :
CDC ndc;

HBITMAP hb;

ndc.CreateCompatibleDC(dc);

Graphics g(ndc->m_hDC);

g.Draw(something..); //drawing on g is here
hb= ???
And how to get a bitmap then? Or maybe I did something wrong..

AD
 
J

Jens =?ISO-8859-1?Q?B=E4ckman?=

AD said:
Hey,
I have a problem with getting a bitmap (HBITMAP) from Device Context using
Graphics object.
Let's say I draw something :
CDC ndc;

HBITMAP hb;

ndc.CreateCompatibleDC(dc);

Graphics g(ndc->m_hDC);

g.Draw(something..); //drawing on g is here
hb= ???
And how to get a bitmap then? Or maybe I did something wrong..

I'm not aware of any such objects or methods in standard C++. They have to
be part of some oddball library for your operating system or compiler. Try
looking for newsgroups about any of them instead
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top