Solved

Gradient Fills

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ODBC Connection Logging, ADO.NET 6 64
if loop in java 3 140
abstract class with all non abstract mentods 6 76
Unix Command -- Challenging  question 7 89
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

776 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