Click here to Skip to main content
16,011,988 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Adding third choice to OK and CANCEL buttons in dialog window Pin
Hamid_RT3-Jun-08 1:02
Hamid_RT3-Jun-08 1:02 
QuestionHow to get the coded format of file? Pin
york5281-Jun-08 4:24
york5281-Jun-08 4:24 
QuestionFind a container Pin
followait1-Jun-08 4:12
followait1-Jun-08 4:12 
AnswerRe: Find a container Pin
Nelek1-Jun-08 7:10
protectorNelek1-Jun-08 7:10 
AnswerRe: Find a container Pin
Jijo.Raj1-Jun-08 7:49
Jijo.Raj1-Jun-08 7:49 
AnswerRe: Find a container Pin
Graham Shanks1-Jun-08 8:41
Graham Shanks1-Jun-08 8:41 
QuestionSave CBitmap object to disk Pin
capint1-Jun-08 0:00
capint1-Jun-08 0:00 
AnswerRe: Save CBitmap object to disk PinPopular
Rajkumar R1-Jun-08 0:15
Rajkumar R1-Jun-08 0:15 
capint wrote:
Bitmap.CreateCompatibleBitmap(pDC,screenMaxX, screenMaxY);
Image.Attach(Bitmap);

this creates only the bitmap object, allocates resources for the bitmap and the color format is compatible with the Device context, but the image it initially contains is blank, you need to fill the image in to the allocated bitmap resource.
I assume you want the image in the Device context then you need to copy the bitmap from dc to this bitmap,

CBitmap Bitmap;
Bitmap.CreateCompatibleBitmap(pDC,screenMaxX, screenMaxY);
CDC dcMemory;
dcMemory.CreateCompatibleDC(pDC);

// Select the bitmap into the in-memory DC
CBitmap* pOldBitmap = dcMemory.SelectObject(&Bitmap);
  
// Copy the bits from the on-screen DC into the 
// in-memory DC 
dcMemory.BitBlt(0, 0, screenMaxX, screenMaxY, pDC, 
         0, 0, SRCCOPY);

dcMemory.SelectObject(pOldBitmap);

GeneralRe: Save CBitmap object to disk Pin
capint1-Jun-08 0:29
capint1-Jun-08 0:29 
AnswerRe: Save CBitmap object to disk Pin
Hamid_RT1-Jun-08 6:34
Hamid_RT1-Jun-08 6:34 
QuestionDirectX9 Surfaces Transparency Pin
Hanan88831-May-08 23:20
Hanan88831-May-08 23:20 
AnswerRe: DirectX9 Surfaces Transparency Pin
Rajkumar R31-May-08 23:58
Rajkumar R31-May-08 23:58 
GeneralRe: DirectX9 Surfaces Transparency Pin
Hanan8881-Jun-08 2:20
Hanan8881-Jun-08 2:20 
QuestionRe: DirectX9 Surfaces Transparency Pin
Rajkumar R1-Jun-08 2:40
Rajkumar R1-Jun-08 2:40 
AnswerRe: DirectX9 Surfaces Transparency Pin
Hanan8881-Jun-08 3:10
Hanan8881-Jun-08 3:10 
GeneralRe: DirectX9 Surfaces Transparency Pin
Rajkumar R1-Jun-08 23:25
Rajkumar R1-Jun-08 23:25 
GeneralRe: DirectX9 Surfaces Transparency Pin
Hanan8882-Jun-08 1:30
Hanan8882-Jun-08 1:30 
GeneralRe: DirectX9 Surfaces Transparency Pin
Rajkumar R2-Jun-08 2:15
Rajkumar R2-Jun-08 2:15 
GeneralRe: DirectX9 Surfaces Transparency Pin
Hanan8882-Jun-08 2:28
Hanan8882-Jun-08 2:28 
AnswerRe: DirectX9 Surfaces Transparency Pin
Rajkumar R2-Jun-08 2:58
Rajkumar R2-Jun-08 2:58 
QuestionHow to ignore the Redraw message Pin
Schehaider_Aymen31-May-08 22:56
Schehaider_Aymen31-May-08 22:56 
AnswerRe: How to ignore the Redraw message Pin
Rajkumar R1-Jun-08 0:04
Rajkumar R1-Jun-08 0:04 
GeneralRe: How to ignore the Redraw message [modified] Pin
Schehaider_Aymen1-Jun-08 0:38
Schehaider_Aymen1-Jun-08 0:38 
GeneralRe: How to ignore the Redraw message Pin
Rajkumar R1-Jun-08 1:03
Rajkumar R1-Jun-08 1:03 
GeneralRe: How to ignore the Redraw message Pin
Schehaider_Aymen1-Jun-08 1:28
Schehaider_Aymen1-Jun-08 1:28 

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.