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


C++ Graphics::DrawPath方法代码示例

本文整理汇总了C++中gdiplus::Graphics::DrawPath方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphics::DrawPath方法的具体用法?C++ Graphics::DrawPath怎么用?C++ Graphics::DrawPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gdiplus::Graphics的用法示例。


在下文中一共展示了Graphics::DrawPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DrawTextOutline

BOOL GdiplusUtilities::DrawTextOutline(Gdiplus::Graphics& graphics, 
					 LPCTSTR lpchText, int cchText, const Gdiplus::Rect& rc, const Gdiplus::StringFormat& format, 
					 const Gdiplus::Font& font, Gdiplus::Color fill, Gdiplus::Color outline, INT outlineWidth,
					 BOOL bCalcOnly/* = FALSE*/, Gdiplus::Rect* rcCalc/* = NULL*/)
{
	Gdiplus::FontFamily fontFamily;
	font.GetFamily(&fontFamily);
	Gdiplus::GraphicsPath path;
	path.AddString(lpchText, cchText, &fontFamily, font.GetStyle(), font.GetHeight(&graphics), rc, &format);

	if (rcCalc != NULL)
	{
		path.GetBounds(rcCalc);
		rcCalc->Inflate(outlineWidth, outlineWidth);
	}
	if (bCalcOnly)
		return TRUE;

	Gdiplus::Pen pen(outline, (Gdiplus::REAL) outlineWidth);
	if (graphics.DrawPath(&pen, &path) == Gdiplus::Ok)
	{
		Gdiplus::SolidBrush brush(fill);
		return graphics.FillPath(&brush, &path) == Gdiplus::Ok;
	}
	return FALSE;
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:26,代码来源:GdiplusUtilities.cpp

示例2: DrawRoundRectangle

void Graphics::DrawRoundRectangle(Pen* pen, const RectF& rc, float d) {
    Gdiplus::Graphics* g = reinterpret_cast<Gdiplus::Graphics*>(_private);
    Gdiplus::Pen* gdiPen = reinterpret_cast<Gdiplus::Pen*>(pen->_private);

    Gdiplus::GraphicsPath gp;
    Gdiplus::RectF r(rc.GetLeft()-1.0f, rc.GetTop()-1.0f, rc.GetWidth(), rc.GetHeight());

    gp.AddArc(r.X, r.Y, d, d, 180.0f, 90.0f);
    gp.AddArc(r.X + r.Width - d, r.Y, d, d, 270.0f, 90.0f);
    gp.AddArc(r.X + r.Width - d, r.Y + r.Height - d, d, d, 0.0f, 90.0f);
    gp.AddArc(r.X, r.Y + r.Height - d, d, d, 90.0f, 90.0f);
    gp.AddLine(r.X, r.Y + r.Height - d, r.X, r.Y + d / 2.0f);

    g->DrawPath(gdiPen, &gp);
}
开发者ID:pixelspark,项目名称:corespark,代码行数:15,代码来源:tjgraphics-gdiplus.cpp

示例3: DrawPath

void Graphics::DrawPath(Pen* pen, GraphicsPath* path) {
    Gdiplus::Graphics* g = reinterpret_cast<Gdiplus::Graphics*>(_private);
    Gdiplus::Pen* gdiPen = reinterpret_cast<Gdiplus::Pen*>(pen->_private);
    Gdiplus::GraphicsPath* gdiPath = reinterpret_cast<Gdiplus::GraphicsPath*>(path->_private);
    g->DrawPath(gdiPen, gdiPath);
}
开发者ID:pixelspark,项目名称:corespark,代码行数:6,代码来源:tjgraphics-gdiplus.cpp


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