亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gradientprogressctrl.cpp

?? 文件捆綁機
?? CPP
字號:

#include "stdafx.h"
#include "GradientProgressCtrl.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/*
Modified by 徐景周 2000.12
功能:漸變色進度條顯示效果
*/

/////////////////////////////////////////////////////////////////////////////
// CGradientProgressCtrl

CGradientProgressCtrl::CGradientProgressCtrl()
{
	// Defaults assigned by CProgressCtrl()
	m_nLower = 0;
	m_nUpper = 100;
	m_nCurrentPosition = 0;
	m_nStep = 10;	
	
	// Initial colors
	m_clrStart	= COLORREF(RGB(255, 0,0));
	m_clrEnd =	 COLORREF(RGB(0,0,255));
	//改變漸變色進度條背景色
	m_clrBkGround = ::GetSysColor(COLOR_3DFACE);
	m_clrText = COLORREF(RGB(255, 255, 255));

	// Initial show percent
	m_bShowPercent = true;
}

CGradientProgressCtrl::~CGradientProgressCtrl()
{
}


BEGIN_MESSAGE_MAP(CGradientProgressCtrl, CProgressCtrl)
	//{{AFX_MSG_MAP(CGradientProgressCtrl)
	ON_WM_PAINT()
	ON_WM_ERASEBKGND()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGradientProgressCtrl message handlers

/////////////////////////////////////////////////////////////////////////////
/* 
	OnPaint

	The main drawing routine.  Consists of two parts
	(1) Call the DrawGradient routine to draw the visible part of the progress gradient
	(2) If needed, show the percentage text

 */
/////////////////////////////////////////////////////////////////////////////
void CGradientProgressCtrl::OnPaint() 
{
	CPaintDC dc(this); // device context for painting

	// TODO: Add your message handler code here
	CRect rectClient;
	GetClientRect(&rectClient);
	// If the current positionis  invalid then we should fade into the  background
	if (m_nCurrentPosition <= m_nLower || m_nCurrentPosition > m_nUpper)
	{
		CRect rect;
		GetClientRect(rect);
		CBrush brush;
		//重畫時漸變色進度條設為自定義顏色
		brush.CreateSolidBrush(m_clrBkGround);//::GetSysColor(COLOR_3DFACE));
		dc.FillRect(&rect, &brush);
		VERIFY(brush.DeleteObject());
		return;
	}
	
	// The actions to take depend on whether or not we are a vertical control
	DWORD dwStyles = GetStyle();
	BOOL bVertical = (BOOL)(dwStyles & PBS_VERTICAL);
	
	
	// Figure out what part should be visible so we can stop the gradient when needed
	float maxWidth;
	if (bVertical)
		maxWidth = ((float)m_nCurrentPosition/(float)m_nUpper * (float)rectClient.bottom);		
	else
		maxWidth = ((float)m_nCurrentPosition/(float)m_nUpper * (float)rectClient.right);
	
	
	// Draw the gradient
		DrawGradient(&dc, rectClient, (int)maxWidth, bVertical);

	// Show percent indicator if needed
	if (m_bShowPercent)
	{
		CString strPercent;
		float fp = 100.0f; 
		fp *= (float)(m_nCurrentPosition-m_nLower); 
		fp /= (float)(m_nUpper-m_nLower); 
		strPercent.Format(_T("%3.0f %%"), fp);
		
		dc.SetTextColor(m_clrText);
		dc.SetBkMode(TRANSPARENT);
		dc.DrawText(strPercent, &rectClient, DT_VCENTER |  DT_CENTER | DT_SINGLELINE);
	}

	// Do not call CProgressCtrl::OnPaint() for painting messages
}


/////////////////////////////////////////////////////////////////////////////
/*
	SetRange

	Overridden base class member to remember where the indicator thinks 
	it is and the boundary range of the control.

	Params
		nLower		lower bound
		nUpper		uppoer bound

*/
/////////////////////////////////////////////////////////////////////////////
void CGradientProgressCtrl:: SetRange(int nLower, int nUpper)
{
	m_nLower = nLower;
	m_nUpper = nUpper;
	m_nCurrentPosition = nLower;
	CProgressCtrl::SetRange(nLower, nUpper);
}

/////////////////////////////////////////////////////////////////////////////
/*

	SetRange32

	Overridden base class member to remember where the indicator thinks 
	it is and the boundary range of the control.

	Params
		nLower		lower bound
		nUpper		uppoer bound

*/
/////////////////////////////////////////////////////////////////////////////
void CGradientProgressCtrl:: SetRange32( int nLower, int nUpper )
{
	m_nLower = nLower;
	m_nUpper = nUpper;
	m_nCurrentPosition = nLower;
	CProgressCtrl::SetRange(nLower, nUpper);
}


/////////////////////////////////////////////////////////////////////////////
/*
	SetPos

	Overridden base class member to retain where the current progress indicator
	is located.

	Params
		nPos		Current position in range

*/
/////////////////////////////////////////////////////////////////////////////
int CGradientProgressCtrl:: SetPos(int nPos)
{
	m_nCurrentPosition = nPos;
	return (CProgressCtrl::SetPos(nPos));
}

/////////////////////////////////////////////////////////////////////////////
/*
	SetStep

	Overridden base class member to retain the step interval used when 
	filling the progress control

	Params
		nStep		step interval for filling progress control

*/
/////////////////////////////////////////////////////////////////////////////
int CGradientProgressCtrl:: SetStep(int nStep)
{
	m_nStep = nStep;
	return (CProgressCtrl::SetStep(nStep));
}

/////////////////////////////////////////////////////////////////////////////
/*
	StepIt

	Overridden base class member to increment the control according to the
	current position and the step interval

	Params
		nStep		step interval for filling progress control

*/
/////////////////////////////////////////////////////////////////////////////
int CGradientProgressCtrl:: StepIt(void)
{
	m_nCurrentPosition += m_nStep;
	return (CProgressCtrl::StepIt());
}


/////////////////////////////////////////////////////////////////////////////
/*
	DrawGradient

	Called from OnPaint, it does most of the work of filling in the client 
	rectangle with the appropriate colors.  The normal routine would fill
	the entire client rectangle, but we truncate the drawing to reflect
	the current position in the progress control

	Params
		pDC			pointer to CPaintDC for rendering
		rectClient	client rectangle where we should draw
		nMaxWidth	where we should stop drawing the gradient
*/
/////////////////////////////////////////////////////////////////////////////
void CGradientProgressCtrl::DrawGradient(CPaintDC *pDC, const RECT &rectClient, const int &nMaxWidth, const BOOL &bVertical)
{
	RECT rectFill;			   // Rectangle for filling band
	float fStep;              // How wide is each band?
	CBrush brush;			// Brush to fill in the bar	

	
	CMemDC1 memDC(pDC);

	// First find out the largest color distance between the start and end colors.  This distance
	// will determine how many steps we use to carve up the client region and the size of each
	// gradient rect.
	int r, g, b;					// First distance, then starting value
	float rStep, gStep, bStep;		// Step size for each color
		
	BOOL  bSameColor = FALSE;		// Handle case if start color == end color

	// Get the color differences
	r = (GetRValue(m_clrEnd) - GetRValue(m_clrStart));
	g = (GetGValue(m_clrEnd) - GetGValue(m_clrStart));
	b =  (GetBValue(m_clrEnd) - GetBValue(m_clrStart));

	// Check to see if colors are same
	if((r == 0) && (g == 0) && (b == 0))
	{
		bSameColor = TRUE;
		//Added the three lines below to fix the drawing 
		//problem which used to occur when both the start 
		//and end colors are same.
		r = GetRValue(m_clrStart);
		g = GetGValue(m_clrStart);
		b = GetBValue(m_clrStart);
	}

	int nSteps;
	//Select max. possible value for nSteps if the colors are equal
	if(bSameColor && m_clrStart == 0)
		nSteps = 255;
	else 	// Make the number of steps equal to the greatest distance
		nSteps = max(abs(r), max(abs(g), abs(b)));	
	
	// Determine how large each band should be in order to cover the
	// client with nSteps bands (one for every color intensity level)
	if (bVertical)
		fStep = (float)rectClient.bottom / (float)nSteps;	
	else
		fStep = (float)rectClient.right / (float)nSteps;

	// Calculate the step size for each color
	rStep = r/(float)nSteps;
	gStep = g/(float)nSteps;
	bStep = b/(float)nSteps;

	// Reset the colors to the starting position
	r = GetRValue(m_clrStart);
	g = GetGValue(m_clrStart);
	b = GetBValue(m_clrStart);
	
	// Start filling bands
	for (int iOnBand = 0; iOnBand < nSteps; iOnBand++) 
	{
		// Fill the vertical control
		if (bVertical)
		{
			::SetRect(&rectFill,
						0,							// Upper left X
						(int)(iOnBand * fStep),		// Upper left Y
						rectClient.right+1,		// Lower right X
						(int)((iOnBand+1) * fStep));// Lower right Y
		
			// CDC::FillSolidRect is faster, but it does not handle 8-bit color depth
			VERIFY(brush.CreateSolidBrush(RGB(r+rStep*iOnBand, g + gStep*iOnBand, b + bStep *iOnBand)));
			memDC.FillRect(&rectFill,&brush);
			VERIFY(brush.DeleteObject());


			// If we are past the maximum for the current position we need to get out of the loop.
			// Before we leave, we repaint the remainder of the client area with the background color.
			if (rectFill.bottom > nMaxWidth)
			{
				::SetRect(&rectFill, 0, rectFill.bottom, rectClient.right, rectClient.bottom);
				VERIFY(brush.CreateSolidBrush(m_clrBkGround));
				memDC.FillRect(&rectFill, &brush);
				VERIFY(brush.DeleteObject());
				return;
			}
		}

		else // Fill the horizontal control
		{
			::SetRect(&rectFill,
						(int)(iOnBand * fStep),     // Upper left X
						 0,							// Upper left Y
						(int)((iOnBand+1) * fStep), // Lower right X
						rectClient.bottom+1);		// Lower right Y
		
			// CDC::FillSolidRect is faster, but it does not handle 8-bit color depth
			VERIFY(brush.CreateSolidBrush(RGB(r+rStep*iOnBand, g + gStep*iOnBand, b + bStep *iOnBand)));
			memDC.FillRect(&rectFill,&brush);
			VERIFY(brush.DeleteObject());


			// If we are past the maximum for the current position we need to get out of the loop.
			// Before we leave, we repaint the remainder of the client area with the background color.
			if (rectFill.right > nMaxWidth)
			{
				::SetRect(&rectFill, rectFill.right, 0, rectClient.right, rectClient.bottom);
				VERIFY(brush.CreateSolidBrush(m_clrBkGround));
				memDC.FillRect(&rectFill, &brush);
				VERIFY(brush.DeleteObject());
				return;
			}
		}

	}
}



/////////////////////////////////////////////////////////////////////////////
/*
	OnEraseBkgnd

	Overridden CWnd function so that all drawing is done in the OnPaint call.
	We return TRUE so that CWnd doesn't try to erase our background.

	Params
		pDC			pointer to CDC for rendering
*/
/////////////////////////////////////////////////////////////////////////////
BOOL CGradientProgressCtrl::OnEraseBkgnd(CDC* pDC) 
{
	// TODO: Add your message handler code here and/or call default
	return TRUE;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕av不卡| 性感美女极品91精品| 亚洲国产三级在线| 国产伦精品一区二区三区免费 | 欧美亚洲自拍偷拍| 久久久亚洲高清| 亚洲无人区一区| 99精品国产视频| 国产日韩欧美一区二区三区综合| 日日夜夜精品免费视频| 91久久精品国产91性色tv| 国产欧美日韩三区| 国产麻豆一精品一av一免费| 欧美一级日韩一级| 亚洲动漫第一页| 色婷婷av一区二区三区之一色屋| 国产午夜精品久久| 国产麻豆精品在线观看| 欧美大胆人体bbbb| 奇米影视7777精品一区二区| 欧美精品 日韩| 亚洲成人动漫在线观看| 欧美性生活久久| 亚洲一区二区不卡免费| 91国产丝袜在线播放| 亚洲欧美偷拍卡通变态| 波多野结衣欧美| 中国色在线观看另类| 国产成人免费视| 国产清纯美女被跳蛋高潮一区二区久久w | 亚洲国产高清在线| 国产传媒久久文化传媒| 国产欧美日韩亚州综合| 成人国产精品免费网站| 国产精品美女久久久久av爽李琼 | 美国欧美日韩国产在线播放| 欧美高清你懂得| 日本va欧美va欧美va精品| 欧美酷刑日本凌虐凌虐| 蜜臀av亚洲一区中文字幕| 欧美一区国产二区| 国产资源精品在线观看| 久久久久久久电影| 91在线看国产| 夜夜嗨av一区二区三区四季av | 91影视在线播放| 日韩一区有码在线| 美女视频黄 久久| 欧美日韩在线播放三区四区| 亚洲一区二区在线免费看| 欧美久久一二三四区| 免费高清视频精品| 国产日韩欧美在线一区| 91免费视频网址| 午夜精品久久久久久| 久久影院午夜片一区| 成人精品免费网站| 亚洲国产精品一区二区久久| 欧美一二三四区在线| 成人免费的视频| 中国色在线观看另类| 精品国产123| 国产电影一区在线| 亚洲综合精品久久| 欧美不卡一区二区三区| 大陆成人av片| 亚洲一区二区三区视频在线播放| 欧美一区二区三区人| 成人黄色免费短视频| 亚洲午夜免费电影| 久久蜜桃香蕉精品一区二区三区| 一本一道久久a久久精品综合蜜臀| 日韩精品一级中文字幕精品视频免费观看| 亚洲精品在线三区| 欧美午夜一区二区三区| 国产精品1区2区| 婷婷综合在线观看| 中文字幕字幕中文在线中不卡视频| 欧美日本免费一区二区三区| 国产99精品国产| 免费欧美在线视频| 一区二区三区精品久久久| 2023国产精品| 欧美色国产精品| www.爱久久.com| 国产精品主播直播| 首页欧美精品中文字幕| 亚洲色图丝袜美腿| www国产亚洲精品久久麻豆| 欧美色视频一区| 91丨九色丨蝌蚪丨老版| 国产成人精品亚洲午夜麻豆| 日本美女一区二区三区视频| 一区二区三区久久| 中文字幕亚洲视频| 亚洲国产精品v| 久久婷婷久久一区二区三区| 3d成人h动漫网站入口| 欧美在线观看视频在线| 91麻豆文化传媒在线观看| 丁香啪啪综合成人亚洲小说| 精品在线一区二区| 老司机免费视频一区二区 | www.亚洲在线| 风间由美一区二区三区在线观看| 精品无码三级在线观看视频 | 久久在线免费观看| 欧美成人aa大片| 精品区一区二区| 精品久久久久一区二区国产| 欧美va日韩va| 日韩免费高清av| 精品免费国产一区二区三区四区| 日韩欧美一区二区视频| 日韩欧美一级片| 精品国产一区二区三区忘忧草| 日韩午夜av电影| 精品国产精品网麻豆系列| 2020国产精品久久精品美国| 精品乱人伦一区二区三区| 久久久综合精品| 亚洲国产岛国毛片在线| 亚洲欧美另类久久久精品2019| 亚洲欧美另类久久久精品| 亚洲乱码国产乱码精品精的特点| 亚洲三级电影全部在线观看高清| 亚洲欧美日韩在线| 亚洲国产日韩a在线播放性色| 亚洲成人一二三| 蜜臀久久99精品久久久久宅男 | 欧美亚洲一区二区三区四区| 欧美日韩午夜影院| 日韩欧美国产系列| 欧美韩国日本不卡| 一区二区三区色| 日韩电影在线免费| 国产乱码精品一区二区三区av| av成人免费在线观看| 欧美在线综合视频| 欧美精品一区二区在线观看| 中文天堂在线一区| 午夜精品视频在线观看| 韩国女主播成人在线观看| 成人性色生活片免费看爆迷你毛片| 色综合av在线| 欧美成人乱码一区二区三区| 国产农村妇女精品| 亚洲成人1区2区| 国产激情精品久久久第一区二区| 色综合中文综合网| 国产成人av电影在线观看| 99r国产精品| 欧美电影精品一区二区| 国产精品久久毛片av大全日韩| 亚洲第一搞黄网站| 国产精品123区| 欧美日韩激情在线| 中文字幕成人网| 蜜臀av一级做a爰片久久| 成人av免费在线播放| 欧美一区二区三区喷汁尤物| 国产精品黄色在线观看| 蜜臀av亚洲一区中文字幕| 97精品视频在线观看自产线路二| 日韩视频免费观看高清完整版 | 欧美日本国产一区| 国产欧美日韩精品a在线观看| 日韩专区欧美专区| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 久久久久综合网| 亚洲国产精品尤物yw在线观看| 国产99久久久久久免费看农村| 欧美一区二区三区思思人| 亚洲免费观看高清完整版在线观看熊| 国产综合色视频| 日韩精品资源二区在线| 亚洲不卡一区二区三区| 99国产欧美另类久久久精品| 久久综合色婷婷| 日韩av网站在线观看| 欧美影视一区二区三区| 国产精品第五页| 国产成人av电影| 久久久久久久久久久99999| 久久精品国产亚洲aⅴ| 欧美三级电影网| 一区二区国产视频| 日本韩国一区二区| 成人欧美一区二区三区黑人麻豆| 国产一区二区成人久久免费影院| 91精品国产欧美一区二区成人| 亚洲第一搞黄网站| 欧美日韩久久不卡| 一个色综合av| 欧美色窝79yyyycom| 亚洲一二三四区| 色哟哟在线观看一区二区三区| 中文字幕中文在线不卡住| 成人性生交大片免费看中文 | 久久人人超碰精品|