[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

folloup to color question

Posted on 1998-06-09
2
Medium Priority
?
184 Views
Last Modified: 2013-11-20
I changed the background in my view in the OnPrepareDC function.This is the code I use:
CBrush Br(RGB(0,0,0));
CRect rcBounds;
 pDC->GetClipBox(&rcBounds);
 CBrush* pOldBrush = pDC->SelectObject(&Br);
 pDC->PatBlt(rcBounds.left, rcBounds.top, rcBounds.Width(), rcBounds.Height(),PATCOPY);
 pDC->SelectObject(pOldBrush);
COLORREF crBk = pDC->GetBkColor();
pDC->SetBkColor(RGB(0,0,0));
COLORREF crTxt = pDC->GetTextColor();
pDC->SetTextColor(RGB(255,0,0));

The problem is when I scroll, I see white flashes come across the screen, as if the view is being redrawn in white, before being drawn as black. Any idea what this may be? Where is it being drawn in white?

Thanks
0
Comment
Question by:smithc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 1317806
The answer to that is WM_ERASEBACKGND and your class has a default brush. Your best bet is to use a memory DC to do your drawing and to then make the copy to the screen. This elminates all flashes.
0
 

Author Comment

by:smithc
ID: 1317807
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question