本文整理汇总了C++中GraphicsPath::Clone方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsPath::Clone方法的具体用法?C++ GraphicsPath::Clone怎么用?C++ GraphicsPath::Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsPath
的用法示例。
在下文中一共展示了GraphicsPath::Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GdipCreateRoundRect
GraphicsPath* GdipCreateRoundRect( RectF& rect, int nRadiusLT, int nRadiusRT, int nRadiusRB, int nRadiusLB )
{
GraphicsPath roundRect;
if( nRadiusLT == 0 )
roundRect.AddLine( rect.GetLeft(), rect.GetTop(), rect.GetRight() - (nRadiusRT<<1), rect.GetTop() );
else
roundRect.AddArc( RectF(rect.GetLeft(), rect.GetTop(), (float)(nRadiusLT<<1), (float)(nRadiusLT<<1)), 180, 90 );
if( nRadiusRT == 0 )
roundRect.AddLine( rect.GetRight(), rect.GetTop(), rect.GetRight(), rect.GetBottom()-(float)(nRadiusRB<<1) );
else
roundRect.AddArc( RectF(rect.GetRight() - (float)(nRadiusRT<<1), rect.GetTop(), (float)(nRadiusRT<<1), (float)(nRadiusRT<<1)), 270, 90 );
if( nRadiusRB == 0 )
roundRect.AddLine( rect.GetRight(), rect.GetBottom(), rect.GetLeft()-(float)(nRadiusLB<<1), rect.GetBottom() );
else
roundRect.AddArc( RectF(rect.GetRight() - (float)(nRadiusRB<<1), rect.GetBottom() -(float)(nRadiusRB<<1), (float)(nRadiusRB<<1), (float)(nRadiusRB<<1)), 0, 90 );
if( nRadiusLB == 0 )
roundRect.AddLine( rect.GetLeft(), rect.GetBottom(), rect.GetLeft(), rect.GetTop()-(float)(nRadiusLT<<1) );
else
roundRect.AddArc( RectF(rect.GetLeft(), rect.GetBottom() -(float)(nRadiusLB<<1), (float)(nRadiusLB<<1), (float)(nRadiusLB<<1)), 90, 90 );
roundRect.CloseFigure();
return roundRect.Clone();
}
示例2: DrawOutlineText
void ProcessDateTime::DrawOutlineText(Graphics *graphics,
Font &font,
const GraphicsPath &path,
const StringFormat &format,
const Brush *brush)
{
GraphicsPath *outlinePath;
outlinePath = path.Clone();
// Outline color and size
UINT tmpOpacity = (UINT)((((float)opacity * 0.01f) * ((float)outlineOpacity * 0.01f)) * 100.0f);
Pen pen(Gdiplus::Color(GetAlphaVal(tmpOpacity) | (outlineColor & 0xFFFFFF)), outlineSize);
pen.SetLineJoin(Gdiplus::LineJoinRound);
// Widen the outline
// It seems that Widen has a huge performance impact on DrawPath call, screw it! We're talking about freaking seconds in some extreme cases...
//outlinePath->Widen(&pen);
// Draw the outline
graphics->DrawPath(&pen, outlinePath);
// Draw the text
graphics->FillPath(brush, &path);
delete outlinePath;
}