本文整理汇总了C++中gdiplus::Graphics::DrawArc方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphics::DrawArc方法的具体用法?C++ Graphics::DrawArc怎么用?C++ Graphics::DrawArc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gdiplus::Graphics
的用法示例。
在下文中一共展示了Graphics::DrawArc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rc
//.........这里部分代码省略.........
LinearGradientBrush brush( rc, m_colBrush1, m_colBrush2,LinearGradientModeVertical );
gdi.FillRectangle( &brush, rc );
}*/
CRect rect3 = rect2;
::InflateRect( &rect3, -1,-1 );
Gdiplus::RectF rc( rect3.left, rect3.top, rect3.Width(), rect3.Height() );
LinearGradientBrush brush( rc, m_colBK, m_colBK,LinearGradientModeVertical );
gdi.FillRectangle( &brush, rc );
Gdiplus::Color colBlack1 = Gdiplus::Color::MakeARGB(30,50,50,50);
Gdiplus::Color colBlack2 = Gdiplus::Color::MakeARGB(15,50,50,50);
Gdiplus::RectF rc1( rect3.left, rect3.top+rect3.Height()/2, rect3.Width(), rect3.Height()/2 );
LinearGradientBrush brush2( rc1, colBlack1, colBlack2,LinearGradientModeVertical );
gdi.FillRectangle( &brush2, rc1 );
return;
}
if( m_enmuDrawType == TOP_ARC )
{
Gdiplus::Pen pen1( m_colFrame1 );
gdi.DrawLine( &pen1, rect.left+5, rect.top, rect.right-7, rect.top );
gdi.DrawLine( &pen1, rect.left, rect.bottom-1, rect.right, rect.bottom-1 );
gdi.DrawLine( &pen1, rect.left, rect.top+5, rect.left, rect.bottom-2 );
gdi.DrawLine( &pen1, rect.right-1, rect.top+5, rect.right-1, rect.bottom-2 );
CRect rect2 = rect;
::InflateRect( &rect2, -1,-1 );
if( !m_bMouseDown )
{
Gdiplus::Pen pen2(m_colFrame2);
gdi.DrawLine( &pen2, rect2.left+4, rect2.top, rect2.right-5, rect2.top );
gdi.DrawLine( &pen2, rect2.left, rect2.bottom-1, rect2.right-1, rect2.bottom-1 );
gdi.DrawLine( &pen2, rect2.left, rect2.top+4, rect2.left, rect2.bottom-2 );
gdi.DrawLine( &pen2, rect2.right-1, rect2.top+4, rect2.right-1, rect2.bottom-2 );
Gdiplus::RectF rectLeftTop2;
rectLeftTop2.X = rect2.left;
rectLeftTop2.Y = rect2.top;
rectLeftTop2.Width = 6;
rectLeftTop2.Height = 6;
gdi.DrawArc( &pen2, rectLeftTop2,180,90 );
Gdiplus::RectF rectRightTop2;
rectRightTop2.X = rect2.right-7;
rectRightTop2.Y = rect2.top;
rectRightTop2.Width = 6;
rectRightTop2.Height = 6;
gdi.DrawArc( &pen2, rectRightTop2,270,90 );
}
Gdiplus::RectF rectLeftTop;
rectLeftTop.X = rect.left;
rectLeftTop.Y = rect.top;
rectLeftTop.Width = 9;
rectLeftTop.Height = 9;
gdi.DrawArc( &pen1, rectLeftTop,180,90 );
Gdiplus::RectF rectRightTop;
rectRightTop.X = rect.right-10;
rectRightTop.Y = rect.top;
rectRightTop.Width = 9;
rectRightTop.Height = 9;
gdi.DrawArc( &pen1, rectRightTop,270,90 );
/*Gdiplus::SolidBrush sb( m_colBrush );
Gdiplus::Brush *pbrush = sb.Clone();*/
if( m_bMouseDown )
{
Gdiplus::RectF rc( rect2.left, rect2.top, rect2.Width(), rect2.Height()/3 );
Gdiplus::Color colBrush1,colBrush2;
colBrush1.SetValue( Gdiplus::Color::MakeARGB(15,1,1,1) );
colBrush2.SetValue( Gdiplus::Color::MakeARGB(0,1,1,1) );
LinearGradientBrush brush( rc, colBrush1, colBrush2,LinearGradientModeVertical );
gdi.FillRectangle( &brush, rc );
}
else
{
Gdiplus::RectF rc( rect2.left, rect2.top, rect2.Width(), rect2.Height()/2 );
rc.Inflate(-1,-1);
LinearGradientBrush brush( rc, m_colBrush1, m_colBrush2,LinearGradientModeVertical );
gdi.FillRectangle( &brush, rc );
}
}
else if( m_enmuDrawType == BOTTON_ARC )
{
}
else if( m_enmuDrawType == RIGHT_ARC )
{
}
else if( m_enmuDrawType == LEFT_ARC )
{
}
else if( m_enmuDrawType & (TOP_ARC|BOTTON_ARC) || m_enmuDrawType & (RIGHT_ARC|LEFT_ARC) )
{
// 四角都有弧线
}
//gdi.DrawString(
}
示例2: DrawArc
void Graphics::DrawArc(Pen* pen, const RectF& rc, float start, float sweep) {
Gdiplus::Graphics* g = reinterpret_cast<Gdiplus::Graphics*>(_private);
Gdiplus::Pen* gdiPen = reinterpret_cast<Gdiplus::Pen*>(pen->_private);
g->DrawArc(gdiPen, Gdiplus::RectF(rc.GetLeft(), rc.GetTop(), rc.GetWidth(), rc.GetHeight()), start, sweep);
}