Click here to Skip to main content
15,896,207 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDrawThemeIcon Pin
Jörgen Sigvardsson26-Aug-04 5:00
Jörgen Sigvardsson26-Aug-04 5:00 
GeneralRe: DrawThemeIcon Pin
JBoschen26-Aug-04 8:06
JBoschen26-Aug-04 8:06 
GeneralRe: DrawThemeIcon Pin
Jörgen Sigvardsson26-Aug-04 9:25
Jörgen Sigvardsson26-Aug-04 9:25 
GeneralRe: DrawThemeIcon Pin
JBoschen26-Aug-04 9:28
JBoschen26-Aug-04 9:28 
GeneralRe: DrawThemeIcon Pin
Jörgen Sigvardsson26-Aug-04 9:32
Jörgen Sigvardsson26-Aug-04 9:32 
GeneralRe: DrawThemeIcon Pin
JBoschen26-Aug-04 9:46
JBoschen26-Aug-04 9:46 
GeneralRe: DrawThemeIcon Pin
Jörgen Sigvardsson26-Aug-04 9:53
Jörgen Sigvardsson26-Aug-04 9:53 
GeneralRe: DrawThemeIcon Pin
cmk26-Aug-04 11:51
cmk26-Aug-04 11:51 
There are two formulas i've seen for calculating a grey value from an RGB :

1. byte grey = (R * 0.299) + (G * 0.587) + (B * 0.114);
2. byte grey = (R * 0.2126) + (G * 0.7152) + (B * 0.0722);

The first is what you will generally find documented. It is based on National Television Standard Committee (NTSC) findings from the 50's. It is based on how the human eye perceives light and tuned to how the color TV phosphour (50's) displays RGB colours.

Other sources say these values are no longer representative of current TV/monitor displays and state that the values in 2. should be used.

Regardless, for each pixel :
byte grey = <1 or 2>;
R = grey;
G = grey;
B = grey;

As you've found there are articles here on how to access/change the pixel values in a bitmap.


...cmk

Save the whales - collect the whole set
GeneralRe: DrawThemeIcon Pin
Jörgen Sigvardsson26-Aug-04 12:02
Jörgen Sigvardsson26-Aug-04 12:02 
GeneralRe: DrawThemeIcon Pin
cmk26-Aug-04 14:43
cmk26-Aug-04 14:43 
GeneralRe: DrawThemeIcon Pin
Jörgen Sigvardsson27-Aug-04 3:54
Jörgen Sigvardsson27-Aug-04 3:54 
GeneralRe: DrawThemeIcon Pin
KaЯl29-Aug-04 22:28
KaЯl29-Aug-04 22:28 
GeneralNo hWnd for Class derived from CEdit Pin
BlackDice26-Aug-04 4:43
BlackDice26-Aug-04 4:43 
GeneralRe: No hWnd for Class derived from CEdit Pin
KaЯl27-Aug-04 4:57
KaЯl27-Aug-04 4:57 
GeneralRe: No hWnd for Class derived from CEdit Pin
BlackDice27-Aug-04 5:41
BlackDice27-Aug-04 5:41 
GeneralRe: No hWnd for Class derived from CEdit Pin
KaЯl27-Aug-04 6:02
KaЯl27-Aug-04 6:02 
GeneralRe: No hWnd for Class derived from CEdit Pin
BlackDice27-Aug-04 6:24
BlackDice27-Aug-04 6:24 
GeneralRe: No hWnd for Class derived from CEdit Pin
KaЯl27-Aug-04 6:47
KaЯl27-Aug-04 6:47 
GeneralRe: No hWnd for Class derived from CEdit Pin
BlackDice27-Aug-04 7:51
BlackDice27-Aug-04 7:51 
Questionmfc newbie, when do i paint? Pin
evilslope26-Aug-04 4:19
evilslope26-Aug-04 4:19 
AnswerRe: mfc newbie, when do i paint? Pin
Maximilien26-Aug-04 4:39
Maximilien26-Aug-04 4:39 
AnswerRe: mfc newbie, when do i paint? Pin
palbano26-Aug-04 5:02
palbano26-Aug-04 5:02 
GeneralRe: mfc newbie, when do i paint? Pin
jmkhael26-Aug-04 6:04
jmkhael26-Aug-04 6:04 
AnswerRe: mfc newbie, when do i paint? Pin
Michael Dunn26-Aug-04 8:59
sitebuilderMichael Dunn26-Aug-04 8:59 
GeneralBorder look&amp;feel with Windows XP Pin
Jean-Michel LE FOL26-Aug-04 4:04
Jean-Michel LE FOL26-Aug-04 4:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.