Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CreateSolidBrush() doesn't make a "solid" brush

Posted on 1997-08-13
3
Medium Priority
?
416 Views
Last Modified: 2013-11-19
When I used CreateSolidBrush() to create a brush, and then used FillRect to fill an area with that brush, I was expecting that every pixel of the entire area would be the same color.   However, the brush doesn't appear to truly be solid.  I end up with what appears to be a dithered pattern.   Is this the way CreateSolidBrush works?   Or am I doing something wrong?   When I truly want to fill an area with a solid color, I am currently, creating a pen and drawing over the entire area with a loop of LineTo calls.
0
Comment
Question by:JohnWeidner
[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
3 Comments
 
LVL 4

Accepted Solution

by:
davmarc earned 400 total points
ID: 1303696
CreateSolidBrush() does not guarantee that it creates a really solid brush: it trues to do it, but the result might be dithered.
Checking if the result of GetNearestColor() and the COLORREF you pass to it are equal will reveal you whether or not a solid brush can be created.

Use GetNearestColor() as parameter for CreateSolidBrush() to be sure that it creates a solid brush.

Davide Marcato.
0
 

Author Comment

by:JohnWeidner
ID: 1303697
Thanks!
0
 
LVL 4

Expert Comment

by:davmarc
ID: 1303698
Glad to help!

Davide Marcato.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

715 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