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


C++ GraphicsPath::Clone方法代码示例

本文整理汇总了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();
}
开发者ID:catcrying,项目名称:dumblebee-view,代码行数:27,代码来源:GdiplusExt.cpp

示例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;
}
开发者ID:wwllww,项目名称:LiveStream_MultiIntance,代码行数:28,代码来源:libDateTime.cpp


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