本文整理汇总了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;
}
示例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;
}
}