Click here to Skip to main content
15,918,243 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CEDit creation through Dialog-Resource, OnNcPaint not called, why ? Pin
ohadp25-May-04 0:02
ohadp25-May-04 0:02 
GeneralRe: CEDit creation through Dialog-Resource, OnNcPaint not called, why ? Pin
Johan Rosengren25-May-04 0:35
Johan Rosengren25-May-04 0:35 
GeneralRe: CEDit creation through Dialog-Resource, OnNcPaint not called, why ? Pin
ohadp26-May-04 20:34
ohadp26-May-04 20:34 
GeneralRe: CEDit creation through Dialog-Resource, OnNcPaint not called, why ? Pin
Johan Rosengren26-May-04 20:39
Johan Rosengren26-May-04 20:39 
QuestionHow to change the Luminosity/Intensity of a Pixel?? Pin
anuragvelekkattu24-May-04 18:43
anuragvelekkattu24-May-04 18:43 
AnswerRe: How to change the Luminosity/Intensity of a Pixel?? Pin
*Dreamz24-May-04 18:56
*Dreamz24-May-04 18:56 
AnswerRe: How to change the Luminosity/Intensity of a Pixel?? Pin
Kamyar Souri24-May-04 20:01
Kamyar Souri24-May-04 20:01 
AnswerRe: How to change the Luminosity/Intensity of a Pixel?? Pin
Branislav25-May-04 2:00
Branislav25-May-04 2:00 
Here are one my solution about it. If you wont to get lighter color put white color otherwise black.
white -> RGB(255, 255, 255) // full light
black -> RGB(0, 0, 0) // light off
1) Make function like this:
a) For increase intensity:
int FindMax(int a, int b, int c)
{
if((double)a > (a+b+c)/3) return a;
if((double)b > (a+b+c)/3) return b;
if((double)c > (a+b+c)/3) return c;
if((double)a == (a+b+c)/3) return a; // for same color
return 255;
}
b) For decrease intensity:
int FindMin(int a, int b, int c)
{
if((double)a < (a+b+c)/3) return a;
if((double)b < (a+b+c)/3) return b;
if((double)c < (a+b+c)/3) return c;
if((double)a == (a+b+c)/3) return a;
return 0;
}
2) Make some variable int intensity = 0; // plus or minus

3) In your function put this code:
int dif;
if(intensity < 0)
{
dif = FindMin(myRGB[j][i].R, myRGB[j][i].G, myRGB[j][i].B);
if(dif > -intensity)
dif = intensity;
else
dif = -dif;
}
else
{
dif = FindMax(myRGB[j][i].R, myRGB[j][i].G, myRGB[j][i].B);
dif -= 255;
if(dif > intensity)
dif = intensity;
}
SetPixel(dc, x+j, y+i, RGB(myRGB[j][i].R+dif, myRGB[j][i].G+dif, myRGB[j][i].B+dif));

GeneralAbout Service Pack Pin
Northbird24-May-04 18:40
Northbird24-May-04 18:40 
GeneralRe: About Service Pack Pin
SimasT24-May-04 23:10
SimasT24-May-04 23:10 
QuestionHow to choose Best Adapter ? Pin
.NetRams24-May-04 18:37
.NetRams24-May-04 18:37 
AnswerRe: How to choose Best Adapter ? Pin
David Crow25-May-04 2:15
David Crow25-May-04 2:15 
Generaldrawing on child windows Pin
ashxly24-May-04 18:31
ashxly24-May-04 18:31 
GeneralRe: drawing on child windows Pin
Johan Rosengren24-May-04 23:27
Johan Rosengren24-May-04 23:27 
GeneralGetTitleBarInfo Pin
TrungHuynh24-May-04 16:51
TrungHuynh24-May-04 16:51 
GeneralRe: GetTitleBarInfo Pin
Michael Dunn24-May-04 17:56
sitebuilderMichael Dunn24-May-04 17:56 
GeneralRe: GetTitleBarInfo Pin
*Dreamz24-May-04 18:46
*Dreamz24-May-04 18:46 
GeneralSTL string case conversion Pin
Indrawati24-May-04 15:52
Indrawati24-May-04 15:52 
GeneralRe: STL string case conversion Pin
Christian Graus24-May-04 17:25
protectorChristian Graus24-May-04 17:25 
GeneralRe: STL string case conversion Pin
Andrew Walker24-May-04 22:27
Andrew Walker24-May-04 22:27 
Generalthreads and modeless dialogs Pin
kfaday24-May-04 15:51
kfaday24-May-04 15:51 
GeneralRe: threads and modeless dialogs Pin
David Crow25-May-04 2:20
David Crow25-May-04 2:20 
GeneralSerial Communication Problem Pin
mhar24-May-04 15:36
professionalmhar24-May-04 15:36 
GeneralRe: Serial Communication Problem Pin
Kamyar Souri24-May-04 20:02
Kamyar Souri24-May-04 20:02 
Generalsize of a compiled exe Pin
locoone24-May-04 15:33
locoone24-May-04 15:33 

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.