Solved

Gradient Fills

Posted on 1997-08-22
2
847 Views
Last Modified: 2013-11-20
How can I implement gradient fills in the client area of a window using MFC ?

0
Comment
Question by:coke
[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 50 total points
ID: 1304632
Gradient fills are usually implemented by dividing the paint region into smaller rectangular regions. Then each of the small rectangular regions are painted with a color and the next region is painted with a small change of color. Pseudo code is the following:

  // assume region is the screen and the screen is divided into
  // 255 regions
  for (int i = 0; i < 256; i++)
  {
    CColor color(i, i, i);
    CBrush brush(color);
    dc.Rectangle(rectangle[i], brush);
  }


0
 
LVL 4

Expert Comment

by:davmarc
ID: 1304633
thui,
I wonder where you found that CColor MFC class... :-)

Davide Marcato.
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

Suggested Solutions

Title # Comments Views Activity
WinWaitActive parameters 12 31
noX challenge 17 134
wordmultiple challenge 12 157
Thin secure Windows 10 5 108
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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