当前位置: 首页>>代码示例>>C++>>正文


C++ Graphics::FillPie方法代码示例

本文整理汇总了C++中Graphics::FillPie方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphics::FillPie方法的具体用法?C++ Graphics::FillPie怎么用?C++ Graphics::FillPie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Graphics的用法示例。


在下文中一共展示了Graphics::FillPie方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DrawObject

void WINAPI duPie::DrawObject(HDC hDC)
{
	duRect rcPie;
	GetRect(&rcPie);
	rcPie.OffsetRect(-rcPie.left, -rcPie.top);
	
	Graphics *gs = new Graphics(hDC);
	Color clrAll = Color(255, GetRValue(m_clrAll), GetGValue(m_clrAll), GetBValue(m_clrAll));
	Color clrPercent = Color(255, GetRValue(m_clrPercent), GetGValue(m_clrPercent), GetBValue(m_clrPercent));
	
	SolidBrush allBrush(clrAll);
	SolidBrush percentBrush(clrPercent);
	Rect rect(3, 3, rcPie.Width() - 6, rcPie.Height() - 6); //½«±ýͼÇøÓòËõС3¸öÏñËØ£¬¾ÍÄÜ»­Ô²ÁË
	
	gs->SetSmoothingMode(SmoothingModeHighQuality);
	gs->FillPie(&allBrush, rect, m_fPercent * 360.0f / 100.0f +270.0f, 360.0f);

	gs->SetSmoothingMode(SmoothingModeHighQuality);
	gs->FillPie(&percentBrush, rect, 270.0f, m_fPercent * 360.0f / 100.0f);
	
	delete gs;
}
开发者ID:blueantst,项目名称:dulib,代码行数:22,代码来源:duPie.cpp

示例2: PaintBkImage

	void CPieUI::PaintBkImage(HDC hDC)
	{
		//MoveToEx(hDC, (int) m_coordinate.cx + m_cXY.cx, (int) m_coordinate.cy + m_cXY.cy, (LPPOINT) NULL); 
		//AngleArc(hDC, m_coordinate.cx + m_cXY.cx, m_coordinate.cy + m_cXY.cy, m_dwRadius, m_dwStartAngle, m_dwEndAngle);
		//MoveToEx(hDC, (int) m_coordinate.cx + m_cXY.cx, (int) m_coordinate.cy + m_cXY.cy, (LPPOINT) NULL); 

		Bitmap* mBtmap;
		Graphics* graphics;

		mBtmap = new Bitmap(m_dwRadius * 2 + 1, m_dwRadius * 2 + 1);
		graphics = Graphics::FromImage(mBtmap);

		graphics->SetSmoothingMode(SmoothingModeHighQuality);

		SolidBrush crGradient(Color(GetRValue(m_dwColor), GetGValue(m_dwColor), GetBValue(m_dwColor)));
		Pen pnHighLight(Color(GetRValue(m_dwColor), GetGValue(m_dwColor), GetBValue(m_dwColor)));

		graphics->FillPie(&crGradient, 
			RectF((REAL)0, 
			(REAL)0, 
			(REAL)m_dwRadius * 2, 
			(REAL)m_dwRadius * 2), 
			(REAL)m_dwStartAngle, 
			(REAL)m_dwEndAngle);
		//graphics->DrawPie(&pnHighLight, 
		//	RectF((REAL)0, 
		//	(REAL)0, 
		//	(REAL)m_dwRadius * 2, 
		//	(REAL)m_dwRadius * 2), 
		//	(REAL)m_dwStartAngle, 
		//	(REAL)m_dwEndAngle);
		delete graphics;
		graphics = NULL;

		Graphics gr(hDC);
		//CachedBitmap* btmp = new CachedBitmap(mBtmap, &gr);

		gr.DrawImage(mBtmap, (int)(m_rcItem.left + m_coordinate.cx - m_dwRadius), m_rcItem.top + m_coordinate.cy - m_dwRadius);	
		if (mBtmap){
			delete mBtmap;
			mBtmap = NULL;
		}
	}
开发者ID:the7day,项目名称:py-ui4win,代码行数:43,代码来源:UIPie.cpp


注:本文中的Graphics::FillPie方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。