Click here to Skip to main content
15,899,026 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: create check box dynamically Pin
Jose Lamas Rios25-Jun-05 14:01
Jose Lamas Rios25-Jun-05 14:01 
GeneralRe: create check box dynamically Pin
A_Fa26-Jun-05 1:24
A_Fa26-Jun-05 1:24 
GeneralCImg Problem Pin
m_amin8325-Jun-05 5:08
m_amin8325-Jun-05 5:08 
GeneralRe: CImg Problem Pin
charlieg25-Jun-05 5:16
charlieg25-Jun-05 5:16 
Generalevolutionry artificial neural network (neural network with genetic algorithm) Pin
aabusalah25-Jun-05 4:32
aabusalah25-Jun-05 4:32 
QuestionCan Check? Print button pressed in Print Preview Pin
ugur_basak25-Jun-05 3:27
ugur_basak25-Jun-05 3:27 
Questionis it possible to control flash input fields using IWebBrowser2? Pin
Anonymous25-Jun-05 1:49
Anonymous25-Jun-05 1:49 
Questionabout Coordinate Map Mode and compatible DC ??? Pin
AntonlioX25-Jun-05 0:07
AntonlioX25-Jun-05 0:07 
How to change the Coordinate Map Mode ,create a compatible DC used to draw ,then call bitblt() to show the picture?

my code in the following , But when I run it ,there is nothing to be showed!

void CTestSetMapModeView::OnLButtonDown(UINT nFlags, CPoint point)
{
CRect rect;
GetClientRect(rect);
CClientDC dc (this);


dc.SetMapMode (MM_ISOTROPIC);
dc.SetWindowExt (rect.Width (), -rect.Height ());
dc.SetViewportExt (rect.Width (), -rect.Height ());
dc.SetViewportOrg (point);

CDC memDC;
memDC.CreateCompatibleDC(&dc);
memDC.SetMapMode(MM_ISOTROPIC);
memDC.SetWindowExt(rect.Width(), -rect.Height());
memDC.SetViewportExt(rect.Width(), -rect.Height());
memDC.SetViewportOrg (point);

CBitmap bitmap,*pOldBitmap;
bitmap.CreateCompatibleBitmap(&dc,rect.Width(),rect.Height());
pOldBitmap=memDC.SelectObject(&bitmap);
memDC.BitBlt(-rect.Width()/2,rect.Height()/2,rect.Width(),rect.Height(),&dc,-rect.Width()/2,rect.Height()/2,SRCCOPY);

//draw some pictures
memDC.Ellipse(-50,50,50,-50);
memDC.Ellipse(-10,20,10,-20);

dc.BitBlt(-rect.Width()/2,rect.Height()/2,rect.Width(),rect.Height(),&memDC,-rect.Width()/2,rect.Height()/2,SRCCOPY );

memDC.SelectObject(pOldBitmap);
bitmap.DeleteObject();

CView::OnLButtonDown(nFlags, point);
}


AnswerRe: about Coordinate Map Mode and compatible DC ??? Pin
charlieg25-Jun-05 5:24
charlieg25-Jun-05 5:24 
GeneralRe: about Coordinate Map Mode and compatible DC ??? Pin
AntonlioX25-Jun-05 6:14
AntonlioX25-Jun-05 6:14 
GeneralRe: about Coordinate Map Mode and compatible DC ??? Pin
AntonlioX25-Jun-05 6:21
AntonlioX25-Jun-05 6:21 
GeneralRe: about Coordinate Map Mode and compatible DC ??? Pin
charlieg25-Jun-05 7:26
charlieg25-Jun-05 7:26 
GeneralRe: about Coordinate Map Mode and compatible DC ??? Pin
AntonlioX25-Jun-05 9:12
AntonlioX25-Jun-05 9:12 
GeneralRe: about Coordinate Map Mode and compatible DC ??? Pin
charlieg25-Jun-05 14:08
charlieg25-Jun-05 14:08 
GeneralRe: about Coordinate Map Mode and compatible DC ??? Pin
Jose Lamas Rios25-Jun-05 18:16
Jose Lamas Rios25-Jun-05 18:16 
GeneralRe: about Coordinate Map Mode and compatible DC ??? Pin
AntonlioX25-Jun-05 19:25
AntonlioX25-Jun-05 19:25 
GeneralRe: about Coordinate Map Mode and compatible DC ??? Pin
Jose Lamas Rios26-Jun-05 11:28
Jose Lamas Rios26-Jun-05 11:28 
GeneralRe: about Coordinate Map Mode and compatible DC ??? Pin
Pazzuzu5-Jul-05 1:20
Pazzuzu5-Jul-05 1:20 
GeneralCList For Non CObject derived class (vs CTypedPtrList) Pin
yccheok24-Jun-05 23:11
yccheok24-Jun-05 23:11 
GeneralRe: CList For Non CObject derived class (vs CTypedPtrList) Pin
ThatsAlok25-Jun-05 1:06
ThatsAlok25-Jun-05 1:06 
GeneralStrange dynamic_cast problem Pin
yccheok24-Jun-05 22:11
yccheok24-Jun-05 22:11 
GeneralRe: Strange dynamic_cast problem Pin
squidev25-Jun-05 8:18
squidev25-Jun-05 8:18 
GeneralRe: Strange dynamic_cast problem Pin
yccheok25-Jun-05 19:41
yccheok25-Jun-05 19:41 
GeneralRe: Strange dynamic_cast problem Pin
squidev26-Jun-05 3:50
squidev26-Jun-05 3:50 
GeneralRe: Strange dynamic_cast problem Pin
yccheok26-Jun-05 5:25
yccheok26-Jun-05 5: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.