Solved

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

Posted on 1997-08-13
3
385 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 100 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Define unique primary key 9 100
unable to delete all specified values regedit 38 890
centeredAverage challenge 8 188
x-bar in Google Sheets 2 129
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

739 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