本文整理匯總了C#中PdfSharp.Drawing.XGraphicsPath.AddRoundedRectangle方法的典型用法代碼示例。如果您正苦於以下問題:C# XGraphicsPath.AddRoundedRectangle方法的具體用法?C# XGraphicsPath.AddRoundedRectangle怎麽用?C# XGraphicsPath.AddRoundedRectangle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PdfSharp.Drawing.XGraphicsPath
的用法示例。
在下文中一共展示了XGraphicsPath.AddRoundedRectangle方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DrawRoundedRectangle
/// <summary>
/// Draws a rectangles with round corners.
/// </summary>
public void DrawRoundedRectangle(XPen pen, XBrush brush, double x, double y, double width, double height,
double ellipseWidth, double ellipseHeight)
{
if (pen == null && brush == null)
throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush);
if (this.drawGraphics)
{
#if GDI
if (this.targetContext == XGraphicTargetContext.GDI)
{
XGraphicsPath path = new XGraphicsPath();
path.AddRoundedRectangle(x, y, width, height, ellipseWidth, ellipseHeight);
DrawPath(pen, brush, path);
}
#endif
#if WPF
if (this.targetContext == XGraphicTargetContext.WPF)
{
this.dc.DrawRoundedRectangle(
brush != null ? brush.RealizeWpfBrush() : null,
pen != null ? pen.RealizeWpfPen() : null,
new Rect(x, y, width, height), ellipseWidth / 2, ellipseHeight / 2);
}
#endif
}
if (this.renderer != null)
this.renderer.DrawRoundedRectangle(pen, brush, x, y, width, height, ellipseWidth, ellipseHeight);
}
示例2: DrawRoundedRectangle
/// <summary>
/// Draws a rectangles with round corners.
/// </summary>
public void DrawRoundedRectangle(XPen pen, XBrush brush, double x, double y, double width, double height,
double ellipseWidth, double ellipseHeight)
{
if (pen == null && brush == null)
throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush);
if (this.drawGraphics)
{
XGraphicsPath path = new XGraphicsPath();
path.AddRoundedRectangle(x, y, width, height, ellipseWidth, ellipseHeight);
DrawPath(pen, brush, path);
//GraphicsPath gdiPath = path.RealizeGdiPath();
//if (brush != null)
// this.gfx.FillPath(brush.RealizeGdiBrush(), gdiPath);
//if (pen != null)
// this.gfx.DrawPath(pen.RealizeGdiPen(), gdiPath);
}
if (this.renderer != null)
this.renderer.DrawRoundedRectangle(pen, brush, x, y, width, height, ellipseWidth, ellipseHeight);
}