Click here to Skip to main content
15,890,995 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Resource Templates Pin
cmk3-Nov-08 20:12
cmk3-Nov-08 20:12 
QuestionI loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
e_ilite3-Nov-08 15:15
e_ilite3-Nov-08 15:15 
AnswerRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
Hamid_RT3-Nov-08 19:42
Hamid_RT3-Nov-08 19:42 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
e_ilite3-Nov-08 20:44
e_ilite3-Nov-08 20:44 
QuestionRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
Mark Salsbery4-Nov-08 4:42
Mark Salsbery4-Nov-08 4:42 
AnswerRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
e_ilite4-Nov-08 14:01
e_ilite4-Nov-08 14:01 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
Mark Salsbery5-Nov-08 4:30
Mark Salsbery5-Nov-08 4:30 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
e_ilite6-Nov-08 14:42
e_ilite6-Nov-08 14:42 
HBITMAP WINAPI ExtractSubBitmap(HBITMAP hSrcBitmap,CPoint ptStart,CPoint ptEnd)
{
HBITMAP hBitmap = NULL;

CDC srcMemDC,desMemDC;
HDC hDC = ::GetDC(0);
srcMemDC.CreateCompatibleDC(hDC);
desMemDC.CreateCompatibleDC(hDC);

srcMemDC.SelectBitmap(hSrcBitmap);
hBitmap = CreateCompatibleBitmap(hDC,ptEnd.x-ptStart.x,ptEnd.y-ptStart.y);
desMemDC.SelectBitmap(hBitmap);

desMemDC.BitBlt(0,0,ptEnd.x-ptStart.x,ptEnd.y-ptStart.y,srcMemDC,ptStart.x,ptStart.y,SRCCOPY);

ReleaseDC(0,hDC);
return hBitmap;
}

And I used the reurn hBitmap to draw.But sometimes I found the passed "HBITMAP hSrcBitmap" have been changed to black.why?

Great & Free windows software for you
http://www.aisnote.com

GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
Mark Salsbery6-Nov-08 15:00
Mark Salsbery6-Nov-08 15:00 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
e_ilite6-Nov-08 15:04
e_ilite6-Nov-08 15:04 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
Mark Salsbery6-Nov-08 15:24
Mark Salsbery6-Nov-08 15:24 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
e_ilite6-Nov-08 15:38
e_ilite6-Nov-08 15:38 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
Mark Salsbery6-Nov-08 16:17
Mark Salsbery6-Nov-08 16:17 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
e_ilite6-Nov-08 18:38
e_ilite6-Nov-08 18:38 
Questionerror C2022: '65279' : too big for character Pin
monsieur_jj3-Nov-08 14:51
monsieur_jj3-Nov-08 14:51 
AnswerRe: error C2022: '65279' : too big for character Pin
Saurabh.Garg3-Nov-08 15:11
Saurabh.Garg3-Nov-08 15:11 
GeneralRe: error C2022: '65279' : too big for character Pin
monsieur_jj3-Nov-08 15:17
monsieur_jj3-Nov-08 15:17 
GeneralRe: error C2022: '65279' : too big for character Pin
Saurabh.Garg3-Nov-08 15:29
Saurabh.Garg3-Nov-08 15:29 
GeneralRe: error C2022: '65279' : too big for character Pin
Bram van Kampen4-Nov-08 11:51
Bram van Kampen4-Nov-08 11:51 
Questionstange behavior with OpenGL in VC++.Net Pin
smorel23-Nov-08 12:34
smorel23-Nov-08 12:34 
Questionndis set from visual c++ Pin
ggfernandez3-Nov-08 8:48
ggfernandez3-Nov-08 8:48 
Questionimage acquition Pin
jjvr3-Nov-08 8:22
jjvr3-Nov-08 8:22 
AnswerRe: image acquition Pin
led mike3-Nov-08 10:35
led mike3-Nov-08 10:35 
GeneralRe: image acquition Pin
Bram van Kampen3-Nov-08 15:30
Bram van Kampen3-Nov-08 15:30 
QuestionConverting from CString to char (or simple text) Pin
shpid3r3-Nov-08 7:35
shpid3r3-Nov-08 7:35 

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.