Click here to Skip to main content
15,894,291 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multimap Error Pin
Sidney6-Jun-02 11:08
Sidney6-Jun-02 11:08 
GeneralRe: Multimap Error Pin
Christian Graus6-Jun-02 11:38
protectorChristian Graus6-Jun-02 11:38 
GeneralRe: Multimap Error Pin
Sidney6-Jun-02 12:18
Sidney6-Jun-02 12:18 
GeneralRe: Multimap Error Pin
Christian Graus6-Jun-02 12:48
protectorChristian Graus6-Jun-02 12:48 
GeneralRe: Multimap Error Pin
Sidney6-Jun-02 13:11
Sidney6-Jun-02 13:11 
GeneralRemoveAll question Pin
6-Jun-02 8:57
suss6-Jun-02 8:57 
GeneralRe: RemoveAll question Pin
Chris Losinger6-Jun-02 9:09
professionalChris Losinger6-Jun-02 9:09 
Questionhow to do flicker-free drawing using memory DC Pin
lucy6-Jun-02 9:04
lucy6-Jun-02 9:04 
I have an SDI MFC application, and I use OnPaint() to draw something to my view. Since my view is updated very frequently, (less than 1 second), I am thinking of using memory DC to reduce the flickering. I tried this:

{
CPaintDC dc(this);
CDC memDc;
memDc.CreateCompatibleDC(&dc);

// create CPen, CBrush, 
// select them to memDc
// and draw using memDc.Ellipse, memDc.MoveTo, memDc.LineTo
// to get the shapes I need

// transfer to display
dc.BitBlt(0,
          0,
          displayWidth,
          displayHeight,
          &memDc,
          0,
          0,
          SRCCOPY);

// restore memDc
// delete all GDI object (CPen, CBrush)
memDc.DeleteDC();
}


but there is nothing on the display. The MSDN document said that I should select a bitmap to my memDc. I did so with a dummy blank bitmap resource I created using resource editor. After I select it to the memDc, there will only be the dummy bitmap displayed on my screen. How could I get my drawing displayed?Confused | :confused: Confused | :confused: Confused | :confused: Dead | X|
AnswerRe: how to do flicker-free drawing using memory DC Pin
Chris Losinger6-Jun-02 9:08
professionalChris Losinger6-Jun-02 9:08 
GeneralRe: how to do flicker-free drawing using memory DC Pin
lucy6-Jun-02 9:19
lucy6-Jun-02 9:19 
GeneralRe: how to do flicker-free drawing using memory DC Pin
lucy6-Jun-02 9:28
lucy6-Jun-02 9:28 
GeneralRe: how to do flicker-free drawing using memory DC Pin
lucy6-Jun-02 9:41
lucy6-Jun-02 9:41 
GeneralRe: how to do flicker-free drawing using memory DC Pin
lucy6-Jun-02 10:00
lucy6-Jun-02 10:00 
GeneralRe: how to do flicker-free drawing using memory DC Pin
Ernest Laurentin6-Jun-02 10:10
Ernest Laurentin6-Jun-02 10:10 
GeneralRe: how to do flicker-free drawing using memory DC Pin
lucy6-Jun-02 10:28
lucy6-Jun-02 10:28 
AnswerRe: how to do flicker-free drawing using memory DC Pin
Chen Venkataraman6-Jun-02 9:50
Chen Venkataraman6-Jun-02 9:50 
GeneralOpen port + Process Pin
orcun colak6-Jun-02 8:55
orcun colak6-Jun-02 8:55 
GeneralMultithreading & Problem :: MFC Pin
valikac6-Jun-02 7:36
valikac6-Jun-02 7:36 
GeneralRe: Multithreading & Problem :: MFC Pin
valikac6-Jun-02 8:37
valikac6-Jun-02 8:37 
GeneralThe Explorer context menu Pin
Nnamdi Onyeyiri6-Jun-02 7:39
Nnamdi Onyeyiri6-Jun-02 7:39 
GeneralRe: The Explorer context menu Pin
Chris Losinger6-Jun-02 9:08
professionalChris Losinger6-Jun-02 9:08 
GeneralRe: The Explorer context menu Pin
Michael Dunn6-Jun-02 15:39
sitebuilderMichael Dunn6-Jun-02 15:39 
GeneralRe: The Explorer context menu Pin
Nnamdi Onyeyiri6-Jun-02 22:48
Nnamdi Onyeyiri6-Jun-02 22:48 
GeneralRe: The Explorer context menu Pin
Nnamdi Onyeyiri6-Jun-02 22:55
Nnamdi Onyeyiri6-Jun-02 22:55 
GeneralRe: The Explorer context menu Pin
Michael Dunn7-Jun-02 7:05
sitebuilderMichael Dunn7-Jun-02 7:05 

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.