Solved

Gradient Fills

Posted on 1997-08-22
2
848 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

Independent Software Vendors: 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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

696 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