本文整理汇总了C++中CWindowGc::DrawEllipse方法的典型用法代码示例。如果您正苦于以下问题:C++ CWindowGc::DrawEllipse方法的具体用法?C++ CWindowGc::DrawEllipse怎么用?C++ CWindowGc::DrawEllipse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWindowGc
的用法示例。
在下文中一共展示了CWindowGc::DrawEllipse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawFace
void CSmiley::DrawFace(CWindowGc &aGc) const
{
// Draw the smiley face, smiling or looking sad
aGc.SetPenColor(KRgbBlack);
// Draw a circle for the face
aGc.DrawEllipse(iSmileyRect);
}
示例2:
/**
Draw function of CConeBackgroundTestDrawer2 class used to draw the control.\n
Sets the brush style to Solid Brush and Pen Style to Null Pen.\n
Sets the brush colour to Blue and paints an ellipse on the control.\n
*/
void CConeBackgroundTestDrawer2::Draw(CWindowGc& aGc, const CCoeControl& /*aControl*/, const TRect& aRect) const
{
aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
aGc.SetPenStyle(CGraphicsContext::ENullPen);
aGc.SetBrushColor(TRgb(0x0000ff));
aGc.DrawEllipse(aRect);
}
示例3: PieDrawer
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CTraceContainer::PieDrawer(CWindowGc& aGc, TPoint aLeftTop, TInt aSize, TInt aProsentages, const TBool& aReverceColor) const
{
TBuf<50> Buffer;
Buffer.Num(aProsentages);
Buffer.Append(_L("%"));
aGc.SetPenColor(KRgbBlack);
if(aReverceColor)
aGc.SetBrushColor(KRgbGreen);
else
aGc.SetBrushColor(KRgbRed);
aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
aGc.DrawEllipse(TRect(aLeftTop.iX,aLeftTop.iY,aLeftTop.iX + aSize,aLeftTop.iY + aSize));
if(aProsentages < 0)
{
Buffer.Copy(_L("N/A"));
if(aReverceColor)
aGc.SetBrushColor(KRgbGreen);
else
aGc.SetBrushColor(KRgbRed);
}
else
{
TInt HelpPie = 0;
if(aReverceColor)
aGc.SetBrushColor(KRgbRed);
else
aGc.SetBrushColor(KRgbGreen);
TInt Angle =((aProsentages * 360) / 100);
if(Angle == 360)
{
aGc.DrawPie(TRect(aLeftTop.iX,aLeftTop.iY,aLeftTop.iX + aSize,aLeftTop.iY + aSize),aLeftTop,aLeftTop);
}
else if(Angle == 45)
{
aGc.DrawPie(TRect(aLeftTop.iX,aLeftTop.iY,aLeftTop.iX + aSize,aLeftTop.iY + aSize),TPoint(aLeftTop.iX + (aSize/2),aLeftTop.iY),TPoint(aLeftTop.iX,aLeftTop.iY));
}
else if(Angle == 135)
{
aGc.DrawPie(TRect(aLeftTop.iX,aLeftTop.iY,aLeftTop.iX + aSize,aLeftTop.iY + aSize),TPoint(aLeftTop.iX + (aSize/2),aLeftTop.iY),TPoint(aLeftTop.iX,aLeftTop.iY + aSize));
}
else if(Angle == 225)
{
aGc.DrawPie(TRect(aLeftTop.iX,aLeftTop.iY,aLeftTop.iX + aSize,aLeftTop.iY + aSize),TPoint(aLeftTop.iX + (aSize/2),aLeftTop.iY),TPoint(aLeftTop.iX + aSize,aLeftTop.iY + aSize));
}
else if(Angle == 315)
{
aGc.DrawPie(TRect(aLeftTop.iX,aLeftTop.iY,aLeftTop.iX + aSize,aLeftTop.iY + aSize),TPoint(aLeftTop.iX + (aSize/2),aLeftTop.iY),TPoint(aLeftTop.iX + aSize,aLeftTop.iY));
}
else if(Angle > 45 && Angle < 135)
{
HelpPie = ((((Angle - 45) * aSize) / 90) + aLeftTop.iY);
aGc.DrawPie(TRect(aLeftTop.iX,aLeftTop.iY,aLeftTop.iX + aSize,aLeftTop.iY + aSize),TPoint(aLeftTop.iX + (aSize/2),aLeftTop.iY),TPoint(aLeftTop.iX,HelpPie));
}
else if(Angle > 135 && Angle < 225)
{
HelpPie = ((((Angle - 135) * aSize) / 90) + aLeftTop.iX);
aGc.DrawPie(TRect(aLeftTop.iX,aLeftTop.iY,aLeftTop.iX + aSize,aLeftTop.iY + aSize),TPoint(aLeftTop.iX + (aSize/2),aLeftTop.iY),TPoint(HelpPie,aLeftTop.iY + aSize));
}
else if(Angle > 225 && Angle < 315)
{
HelpPie = (((aLeftTop.iY + aSize) - ((Angle - 225) * aSize) / 90));
aGc.DrawPie(TRect(aLeftTop.iX,aLeftTop.iY,aLeftTop.iX + aSize,aLeftTop.iY + aSize),TPoint(aLeftTop.iX + (aSize/2),aLeftTop.iY),TPoint(aLeftTop.iX + aSize,HelpPie));
}
else if(Angle > 0 && Angle < 45)
{
HelpPie = (((aLeftTop.iX + (aSize/2)) - ((Angle) * (aSize/2)) / 45));
aGc.DrawPie(TRect(aLeftTop.iX,aLeftTop.iY,aLeftTop.iX + aSize,aLeftTop.iY + aSize),TPoint(aLeftTop.iX + (aSize/2),aLeftTop.iY),TPoint(HelpPie,aLeftTop.iY));
}
else if(Angle > 315 && Angle < 360)
{
HelpPie = (((aLeftTop.iX + aSize) - ((Angle - 315) * (aSize/2)) / 45));
aGc.DrawPie(TRect(aLeftTop.iX,aLeftTop.iY,aLeftTop.iX + aSize,aLeftTop.iY + aSize),TPoint(aLeftTop.iX + (aSize/2),aLeftTop.iY),TPoint(HelpPie,aLeftTop.iY));
}
if(aReverceColor)
{
if(Angle > 180)
aGc.SetBrushColor(KRgbGreen);
else
aGc.SetBrushColor(KRgbRed);
}
else
{
if(Angle > 180)
aGc.SetBrushColor(KRgbRed);
else
aGc.SetBrushColor(KRgbGreen);
}
//.........这里部分代码省略.........