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

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

?? gradientprogressctrl.cpp

?? 一個小的文件分割器。
?? CPP
字號:
/*
Modified by 徐景周 2000.12
功能:漸變色進度條顯示效果
*/

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

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

/////////////////////////////////////////////////////////////////////////////
// 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一区二区三区免费野_久草精品视频
91香蕉视频在线| 91国产免费观看| 精品一区二区成人精品| 免费观看日韩av| 午夜精品成人在线视频| 亚洲bdsm女犯bdsm网站| 蜜桃视频在线观看一区| 美女国产一区二区三区| 精品一区二区三区欧美| 国产成人av电影在线| 波多野结衣一区二区三区| 91猫先生在线| 69堂成人精品免费视频| 欧美成人video| 国产精品嫩草影院com| 亚洲精品伦理在线| 琪琪久久久久日韩精品| 国产成人一级电影| 色天使色偷偷av一区二区| 91麻豆精品国产91久久久资源速度| 日韩一区二区三区视频在线观看| 国产三区在线成人av| 18欧美亚洲精品| 婷婷久久综合九色综合绿巨人 | 国产性色一区二区| 中文在线一区二区| 亚洲电影中文字幕在线观看| 麻豆免费看一区二区三区| 国产精品一区一区| 91成人国产精品| 日韩视频国产视频| 亚洲人妖av一区二区| 石原莉奈在线亚洲三区| 大尺度一区二区| 欧美日韩国产高清一区二区三区| 久久综合丝袜日本网| 亚洲香肠在线观看| 国产麻豆欧美日韩一区| 欧美在线观看视频一区二区| 欧美草草影院在线视频| 亚洲欧美偷拍另类a∨色屁股| 青青草成人在线观看| 99久久亚洲一区二区三区青草| 欧美丰满美乳xxx高潮www| 欧美韩日一区二区三区四区| 无码av免费一区二区三区试看| 成人免费观看男女羞羞视频| 欧美成人性福生活免费看| 亚洲丝袜另类动漫二区| 国产精品一区二区不卡| 日韩欧美在线观看一区二区三区| 一区二区三区欧美日韩| 丁香亚洲综合激情啪啪综合| 日韩免费看的电影| 日韩中文欧美在线| 欧美色综合影院| 亚洲美女视频一区| 成人少妇影院yyyy| 久久综合久久久久88| 久久精品久久精品| 精品成人一区二区三区| 麻豆91精品视频| 波多野结衣一区二区三区 | 亚洲欧美怡红院| 紧缚捆绑精品一区二区| 7777精品伊人久久久大香线蕉经典版下载| 国产精品乱码人人做人人爱 | 欧美日韩精品一区二区三区四区| 日韩毛片视频在线看| 成人午夜电影小说| 久久久久免费观看| 国产精品影视天天线| 久久久精品国产免费观看同学| 久久国内精品视频| 亚洲精品在线电影| 亚洲色图制服诱惑| 无吗不卡中文字幕| 色婷婷亚洲婷婷| 亚洲男人的天堂一区二区| 丁香天五香天堂综合| 久久久精品国产99久久精品芒果| 国产一区二区三区综合| 久久久噜噜噜久久中文字幕色伊伊| 极品少妇xxxx精品少妇偷拍| 久久免费的精品国产v∧| 粉嫩av亚洲一区二区图片| 日本一区二区三区dvd视频在线| 成人精品在线视频观看| 一区二区三区在线看| 欧美日韩一区精品| 久久99最新地址| 中文字幕免费不卡| 欧美吻胸吃奶大尺度电影| 日本vs亚洲vs韩国一区三区二区| 精品动漫一区二区三区在线观看| 国产在线观看一区二区| 国产精品久久久久aaaa樱花| 欧美性淫爽ww久久久久无| 日本中文一区二区三区| 久久久久久久av麻豆果冻| 不卡影院免费观看| 日韩电影一区二区三区四区| 日本一区二区视频在线观看| 91免费视频网| 国产在线看一区| 亚洲永久免费视频| 精品国产网站在线观看| 一本一本大道香蕉久在线精品 | 91精品国产黑色紧身裤美女| 国产一区91精品张津瑜| 亚洲一区二区偷拍精品| 亚洲精品在线一区二区| 日本高清不卡一区| 国产综合久久久久影院| 亚洲va韩国va欧美va| 欧美国产97人人爽人人喊| 欧美丰满少妇xxxxx高潮对白| 成人高清视频在线观看| 极品尤物av久久免费看| 亚洲国产视频a| 国产精品污网站| 欧美成人a∨高清免费观看| 欧美三级电影在线看| 成人网在线免费视频| 韩国一区二区三区| 婷婷国产v国产偷v亚洲高清| 亚洲免费观看在线视频| 久久九九影视网| 日韩一级二级三级精品视频| 欧洲精品在线观看| 99re成人精品视频| 福利一区二区在线| 精品亚洲成a人| 老司机精品视频在线| 亚洲va韩国va欧美va| 一区二区三区日韩欧美| 亚洲免费伊人电影| 中文字幕av一区二区三区高| 久久久久久久性| 日韩欧美综合一区| 欧美一区二区三区人| 欧美揉bbbbb揉bbbbb| 欧美日韩国产区一| 欧美日韩亚洲综合一区二区三区| 99re66热这里只有精品3直播 | 99久久er热在这里只有精品66| 久久99精品国产麻豆不卡| 免费在线成人网| 日日噜噜夜夜狠狠视频欧美人| 亚洲自拍另类综合| 亚洲成人av中文| 午夜欧美大尺度福利影院在线看| 亚洲一区二区三区四区在线免费观看 | 91久久香蕉国产日韩欧美9色| 成人性视频免费网站| 高清av一区二区| 91亚洲永久精品| 欧美专区日韩专区| 69av一区二区三区| 欧美不卡视频一区| 国产日韩欧美电影| 亚洲丝袜另类动漫二区| 亚洲一区在线观看免费 | 黄色精品一二区| 成人精品视频一区二区三区尤物| 国产电影一区二区三区| 不卡的av电影在线观看| 97se亚洲国产综合自在线| 欧美亚洲国产一区二区三区| 欧美日韩国产乱码电影| 精品欧美乱码久久久久久1区2区| 精品国产乱码91久久久久久网站| 久久久激情视频| 一区二区三区中文字幕精品精品| 亚洲国产精品一区二区久久恐怖片| 日本成人中文字幕在线视频 | 91网页版在线| 5858s免费视频成人| 久久蜜桃av一区精品变态类天堂| 国产精品二三区| 日韩福利电影在线观看| 成人综合日日夜夜| 欧美日韩国产首页在线观看| 久久九九全国免费| 亚洲国产一区二区a毛片| 国精产品一区一区三区mba视频| hitomi一区二区三区精品| 欧美日韩电影在线播放| 久久精品人人做人人爽人人| 亚洲成人福利片| 高清shemale亚洲人妖| 91精品国模一区二区三区| 欧美激情在线观看视频免费| 亚洲一区成人在线| 国产成人久久精品77777最新版本| 91国产精品成人| 国产欧美日韩视频在线观看| 日本中文在线一区| 欧美亚洲综合另类| 国产视频一区二区在线|