Click here to Skip to main content
15,913,773 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralLoading dll issue during debuging Pin
catmust29-Oct-03 13:48
catmust29-Oct-03 13:48 
Generalmemory allocation issues Pin
Steven M Hunt29-Oct-03 13:21
Steven M Hunt29-Oct-03 13:21 
GeneralRe: memory allocation issues Pin
Christian Graus29-Oct-03 15:52
protectorChristian Graus29-Oct-03 15:52 
Generalsockets and threads Pin
michael_cowan29-Oct-03 13:14
michael_cowan29-Oct-03 13:14 
GeneralWINS Pin
Jair29-Oct-03 13:06
Jair29-Oct-03 13:06 
GeneralRe: WINS Pin
Jair1-Nov-03 3:29
Jair1-Nov-03 3:29 
QuestionXP GetSysColor()??? Pin
alex.barylski29-Oct-03 12:17
alex.barylski29-Oct-03 12:17 
AnswerRe: XP GetSysColor()??? Pin
michael_cowan29-Oct-03 13:00
michael_cowan29-Oct-03 13:00 
Hi ...

Umm, I didn't get time to test it but I threw this together. I think it's what you want. It'll return a colour based on the colour you supply it and the value of dBrighten and bContrast. These double values are to be between 0 and 1 (0% to 100% divided by 100).

Hope this helps,
Mike

#include <math.h>
.
.
COLORREF LightenColour(COLORREF colour, double dBrighten, double dContrast)
{
	const int	GREY		=	0x7f;	
	const int	m_nContrast	=	90;
	
	int	nStepB = (int)floor(dBrighten * GREY);
	double	dStepC = dContrast;
		
	int nColourValue;
	
	// RED
	nColourValue = GetRValue(colour) + nStepB; // for brightness
	nColourValue = (int)floor((nColourValue - GREY) * dStepC) + GREY; // for contrast
	// add tint, invert.. whatever here 
	int nR = (nColourValue < 0x00) ? 0x00 : (nColourValue > 0xff) ? 0xff : nColourValue;
	
	// GREEN
	nColourValue = GetGValue(colour) + nStepB;
	nColourValue = (int)floor((nColourValue - GREY) * dStepC) + GREY;
	int nG = (nColourValue < 0x00) ? 0x00 : (nColourValue > 0xff) ? 0xff : nColourValue;
	
	// BLUE
	nColourValue = GetBValue(colour) + nStepB;
	nColourValue = (int)floor((nColourValue - GREY) * dStepC) + GREY;
	int nB = (nColourValue < 0x00) ? 0x00 : (nColourValue > 0xff) ? 0xff : nColourValue;
	
	return RGB(nR, nG, nB);	
};

GeneralRe: XP GetSysColor()??? Pin
alex.barylski29-Oct-03 15:17
alex.barylski29-Oct-03 15:17 
GeneralCalling a dialog from a dll question Pin
Steve Messer29-Oct-03 11:53
Steve Messer29-Oct-03 11:53 
GeneralRe: Calling a dialog from a dll question Pin
igor196029-Oct-03 12:49
igor196029-Oct-03 12:49 
GeneralRe: Calling a dialog from a dll question Pin
Steve Messer29-Oct-03 14:35
Steve Messer29-Oct-03 14:35 
GeneralProblem with control arrays Pin
Stephan Poirier29-Oct-03 11:49
Stephan Poirier29-Oct-03 11:49 
GeneralRe: Problem with control arrays Pin
alex.barylski29-Oct-03 12:04
alex.barylski29-Oct-03 12:04 
GeneralRe: Problem with control arrays Pin
Joaquín M López Muñoz29-Oct-03 12:05
Joaquín M López Muñoz29-Oct-03 12:05 
GeneralRe: Problem with control arrays Pin
Stephan Poirier29-Oct-03 12:43
Stephan Poirier29-Oct-03 12:43 
GeneralRe: Problem with control arrays Pin
Stephan Poirier29-Oct-03 13:01
Stephan Poirier29-Oct-03 13:01 
GeneralATL 7 collection class Pin
Urban Olars29-Oct-03 10:45
Urban Olars29-Oct-03 10:45 
QuestionCan someone clarify some Windows' terms for me Pin
mwhannan29-Oct-03 10:38
mwhannan29-Oct-03 10:38 
AnswerRe: Can someone clarify some Windows' terms for me Pin
alex.barylski29-Oct-03 11:07
alex.barylski29-Oct-03 11:07 
GeneralRe: Can someone clarify some Windows' terms for me Pin
Blake Coverett29-Oct-03 11:12
Blake Coverett29-Oct-03 11:12 
AnswerRe: Can someone clarify some Windows' terms for me Pin
Blake Coverett29-Oct-03 11:10
Blake Coverett29-Oct-03 11:10 
AnswerRe: Can someone clarify some Windows' terms for me Pin
mwhannan29-Oct-03 17:10
mwhannan29-Oct-03 17:10 
GeneralLooking for products for relational and code generation Pin
mcgahanfl29-Oct-03 10:35
mcgahanfl29-Oct-03 10:35 
GeneralHelp !!! Pin
Guillermo Rivero29-Oct-03 10:19
Guillermo Rivero29-Oct-03 10:19 

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.