Click here to Skip to main content
15,921,959 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to design multiple inheritance classes? Pin
Tim Smith27-Jul-05 17:07
Tim Smith27-Jul-05 17:07 
Generalquestion about tab control Pin
firebolt7727-Jul-05 16:33
firebolt7727-Jul-05 16:33 
GeneralRe: question about tab control Pin
Christian Graus27-Jul-05 16:50
protectorChristian Graus27-Jul-05 16:50 
GeneralRe: question about tab control Pin
firebolt7727-Jul-05 17:00
firebolt7727-Jul-05 17:00 
GeneralRe: question about tab control Pin
Christian Graus27-Jul-05 17:04
protectorChristian Graus27-Jul-05 17:04 
GeneralRe: question about tab control Pin
firebolt7727-Jul-05 17:15
firebolt7727-Jul-05 17:15 
GeneralRe: question about tab control Pin
Christian Graus27-Jul-05 17:24
protectorChristian Graus27-Jul-05 17:24 
GeneralSearching for help on-line Pin
onlysaint27-Jul-05 15:14
onlysaint27-Jul-05 15:14 
GeneralRe: Searching for help on-line Pin
koothkeeper27-Jul-05 16:10
professionalkoothkeeper27-Jul-05 16:10 
GeneralJOB_INFO_2 Time member not set Pin
koothkeeper27-Jul-05 14:15
professionalkoothkeeper27-Jul-05 14:15 
GeneralRe: JOB_INFO_2 Time member not set Pin
Graham Bradshaw27-Jul-05 15:04
Graham Bradshaw27-Jul-05 15:04 
GeneralRe: JOB_INFO_2 Time member not set Pin
koothkeeper27-Jul-05 16:03
professionalkoothkeeper27-Jul-05 16:03 
GeneralRe: JOB_INFO_2 Time member not set Pin
Graham Bradshaw27-Jul-05 22:14
Graham Bradshaw27-Jul-05 22:14 
GeneralRe: JOB_INFO_2 Time member not set Pin
Blake Miller28-Jul-05 5:23
Blake Miller28-Jul-05 5:23 
GeneralRe: JOB_INFO_2 Time member not set Pin
David Crow28-Jul-05 5:47
David Crow28-Jul-05 5:47 
GeneralRe: JOB_INFO_2 Time member not set Pin
koothkeeper3-Aug-05 5:52
professionalkoothkeeper3-Aug-05 5:52 
Generalwindowsmessage Pin
_tasleem27-Jul-05 13:06
_tasleem27-Jul-05 13:06 
GeneralRe: windowsmessage Pin
John R. Shaw28-Jul-05 5:59
John R. Shaw28-Jul-05 5:59 
Generalextract byte code from string for COM1 Pin
quarry_0627-Jul-05 12:37
quarry_0627-Jul-05 12:37 
GeneralRe: extract byte code from string for COM1 Pin
John R. Shaw28-Jul-05 6:15
John R. Shaw28-Jul-05 6:15 
Question.* and .*? Pin
John R. Shaw27-Jul-05 11:10
John R. Shaw27-Jul-05 11:10 
AnswerRe: .* and .*? Pin
includeh1027-Jul-05 11:55
includeh1027-Jul-05 11:55 
GeneralRe: .* and .*? Pin
John R. Shaw27-Jul-05 12:10
John R. Shaw27-Jul-05 12:10 
GeneralGDI + to save graphics from the screen into a file Pin
flamy27-Jul-05 10:47
flamy27-Jul-05 10:47 
GeneralRe: GDI + to save graphics from the screen into a file Pin
mark novak27-Jul-05 15:04
mark novak27-Jul-05 15:04 
I have never used GDI+ till today when I decided to look into your question so I'm not a GDI+ expert, this is just what worked for me.

First DrawImage() takes an image (in your case bm) and draws it to what it's been initilized to draw on. I'm guessing you did a Graphics gr(dc.m_hDC) so it's going to try to draw a blank image to your window's DC. What you want, is to take what's on graphics (the DC) and put it into the Bitmap. This is tricky because graphics acts as an interface on which to manipulate something. You could get it directly from the DC like this however, once you've finished your drawing.

Bitmap* bitmap = new Bitmap(50, 50, &graphics);<br />
Graphics* bitmap_graphics = graphics.FromImage(bitmap);<br />
	<br />
HDC source_dc = graphics.GetHDC();<br />
HDC destination_dc = bitmap_graphics->GetHDC();<br />
<br />
BitBlt(destination_dc, 0, 0, 50, 50, source_dc, 0, 0, SRCCOPY);<br />
<br />
graphics.ReleaseHDC(destination_dc);<br />
bitmap_graphics->ReleaseHDC(destination_dc);


Hope this helps.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.