Click here to Skip to main content
16,014,591 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MDI Doc/View CDatabase app general questions Pin
Dennis Gourjii15-Mar-06 3:17
Dennis Gourjii15-Mar-06 3:17 
GeneralRe: MDI Doc/View CDatabase app general questions Pin
23_44415-Mar-06 5:39
23_44415-Mar-06 5:39 
GeneralRe: MDI Doc/View CDatabase app general questions Pin
Dennis Gourjii16-Mar-06 2:55
Dennis Gourjii16-Mar-06 2:55 
Question[Message Deleted] Pin
ddmcr15-Mar-06 2:53
ddmcr15-Mar-06 2:53 
AnswerRe: Registering extension and icon for your application Pin
Dennis Gourjii15-Mar-06 3:07
Dennis Gourjii15-Mar-06 3:07 
GeneralRe: Registering extension and icon for your application Pin
toxcct15-Mar-06 4:30
toxcct15-Mar-06 4:30 
AnswerRe: Registering extension and icon for your application Pin
David Crow15-Mar-06 3:17
David Crow15-Mar-06 3:17 
QuestionWrite memory bitmap to BMP file? Pin
FleetAdmiral15-Mar-06 2:19
FleetAdmiral15-Mar-06 2:19 
In a MFC dialog based programm, I add a button control, and the corresponding message function is:
void CHhhhDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CClientDC clientDC(this);
CDC memDC;
memDC.CreateCompatibleDC(&clientDC);
CRect rcClient;
GetClientRect(&rcClient);
CBitmap membitmap;
membitmap.CreateCompatibleBitmap(&clientDC, rcClient.Width(),
rcClient.Height());
memDC.SelectObject(&membitmap);
for (int x = 0; x < rcClient.right; x ++)
{
for (int y = 0; y < rcClient.bottom; y ++)
{
memDC.SetPixel(x, y, x < y ? RGB(255, 255, 0) : RGB(255, 0, 0));
}
}
clientDC.BitBlt(0, 0, rcClient.Width(), rcClient.Height(), &memDC, 0, 0, SRCCOPY);
}
Now, I want to comments the last statement, and save the memeory bitmap (memDC) to a BMP file.

How can I achieve this objective.

Thanks!
AnswerRe: Write memory bitmap to BMP file? Pin
Hamid_RT15-Mar-06 2:40
Hamid_RT15-Mar-06 2:40 
AnswerRe: Write memory bitmap to BMP file? Pin
David Crow15-Mar-06 2:42
David Crow15-Mar-06 2:42 
QuestionCrystal Reports Dev 11 Pin
xdeveloper_del15-Mar-06 1:59
xdeveloper_del15-Mar-06 1:59 
QuestionHelp me E_FAIL Error Pin
dharani15-Mar-06 1:33
dharani15-Mar-06 1:33 
AnswerRe: Help me E_FAIL Error Pin
James R. Twine15-Mar-06 3:47
James R. Twine15-Mar-06 3:47 
GeneralRe: Help me E_FAIL Error Pin
dharani15-Mar-06 16:24
dharani15-Mar-06 16:24 
GeneralRe: Help me E_FAIL Error Pin
dharani15-Mar-06 17:30
dharani15-Mar-06 17:30 
QuestionNewbie - odbc/mysql Pin
antonaras_marcou15-Mar-06 1:14
antonaras_marcou15-Mar-06 1:14 
AnswerRe: Newbie - odbc/mysql Pin
David Crow15-Mar-06 2:44
David Crow15-Mar-06 2:44 
AnswerRe: Newbie - odbc/mysql Pin
Dennis Gourjii15-Mar-06 3:26
Dennis Gourjii15-Mar-06 3:26 
QuestionLSA API's Pin
Putta_V15-Mar-06 0:19
Putta_V15-Mar-06 0:19 
AnswerRe: LSA API's Pin
Hamid_RT15-Mar-06 0:39
Hamid_RT15-Mar-06 0:39 
AnswerRe: LSA API's Pin
Hamid_RT18-Mar-06 2:41
Hamid_RT18-Mar-06 2:41 
Questionfax with oulook Pin
martina7615-Mar-06 0:06
martina7615-Mar-06 0:06 
QuestionHow do I know which font is used in dialog box Pin
IlanTal14-Mar-06 23:44
IlanTal14-Mar-06 23:44 
AnswerRe: How do I know which font is used in dialog box Pin
grigsoft14-Mar-06 23:50
grigsoft14-Mar-06 23:50 
GeneralRe: How do I know which font is used in dialog box Pin
IlanTal15-Mar-06 0:25
IlanTal15-Mar-06 0:25 

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.