Click here to Skip to main content
15,888,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can Get Total Size of ListCtrl? Pin
Nishad S8-Oct-08 22:13
Nishad S8-Oct-08 22:13 
QuestionBlack Border around Dialog Box. Pin
gothic_coder8-Oct-08 21:09
gothic_coder8-Oct-08 21:09 
AnswerRe: Black Border around Dialog Box. Pin
Nishad S8-Oct-08 22:11
Nishad S8-Oct-08 22:11 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder8-Oct-08 23:07
gothic_coder8-Oct-08 23:07 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S8-Oct-08 23:22
Nishad S8-Oct-08 23:22 
GeneralRe: Black Border around Dialog Box. [modified] Pin
gothic_coder8-Oct-08 23:29
gothic_coder8-Oct-08 23:29 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 0:13
Nishad S9-Oct-08 0:13 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder9-Oct-08 0:29
gothic_coder9-Oct-08 0:29 
void GradientFillRect(HDC hdc, LPRECT rcGradient, COLORREF start, COLORREF end, BOOL isVertical)
{
	BYTE startRed = GetRValue(start);
	BYTE startGreen = GetGValue(start);
	BYTE startBlue = GetBValue(start);

	BYTE endRed = GetRValue(end);
	BYTE endGreen = GetGValue(end);
	BYTE endBlue = GetBValue(end);

	HBRUSH endColor = CreateSolidBrush(end);
	FillRect(hdc, rcGradient, endColor);
	DeleteObject(endColor);
	
	//Gradient line width/height
	int dy = 1;

	int length = (isVertical ? rcGradient->bottom - rcGradient->top : rcGradient->right - rcGradient->left) - dy;

	for (int dn = 0; dn <= length; dn += dy)
	{
		BYTE currentRed = (BYTE)MulDiv(endRed-startRed, dn, length) + startRed;
		BYTE currentGreen = (BYTE)MulDiv(endGreen-startGreen, dn, length) + startGreen;
		BYTE currentBlue = (BYTE)MulDiv(endBlue-startBlue, dn, length) + startBlue;

		RECT currentRect = {0};
		if (isVertical)
		{
			currentRect.left = rcGradient->left;
			currentRect.top = rcGradient->top + dn;
			currentRect.right = currentRect.left + rcGradient->right - rcGradient->left;
			currentRect.bottom = currentRect.top + dy;

		}
		else
		{
			currentRect.left = rcGradient->left + dn;
			currentRect.top = rcGradient->top;
			currentRect.right = currentRect.left + dy;
			currentRect.bottom = currentRect.top + rcGradient->bottom - rcGradient->top;
		}

		HBRUSH currentColor = CreateSolidBrush(RGB(currentRed, currentGreen, currentBlue));
		FillRect(hdc, ¤tRect, currentColor);
		DeleteObject(currentColor);
	}
}

GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 0:48
Nishad S9-Oct-08 0:48 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder9-Oct-08 0:56
gothic_coder9-Oct-08 0:56 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 1:05
Nishad S9-Oct-08 1:05 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 0:52
Nishad S9-Oct-08 0:52 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder9-Oct-08 0:59
gothic_coder9-Oct-08 0:59 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 1:20
Nishad S9-Oct-08 1:20 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder9-Oct-08 1:47
gothic_coder9-Oct-08 1:47 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 2:54
Nishad S9-Oct-08 2:54 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder9-Oct-08 3:01
gothic_coder9-Oct-08 3:01 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 17:34
Nishad S9-Oct-08 17:34 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder9-Oct-08 21:29
gothic_coder9-Oct-08 21:29 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 23:36
Nishad S9-Oct-08 23:36 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder10-Oct-08 0:32
gothic_coder10-Oct-08 0:32 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S10-Oct-08 1:13
Nishad S10-Oct-08 1:13 
Questiondifferent result on x86 and x64 Pin
George_George8-Oct-08 20:43
George_George8-Oct-08 20:43 
AnswerRe: different result on x86 and x64 Pin
CPallini9-Oct-08 0:27
mveCPallini9-Oct-08 0:27 
GeneralRe: different result on x86 and x64 Pin
George_George9-Oct-08 0:58
George_George9-Oct-08 0:58 

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.