?
Solved

Gradient Fills

Posted on 1997-08-22
2
Medium Priority
?
850 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 100 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 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