Class XGraphics
Represents a drawing surface for a fixed size page.
public sealed class XGraphics
- Inheritance
-
objectXGraphics
- Extension Methods
Properties
- GraphicsStateLevel
Gets the current graphics state level. The default value is 0. Each call of Save or BeginContainer increased and each call of Restore or EndContainer decreased the value by 1.
- Internals
Permits access to internal data.
- PageDirection
Gets or sets the value indicating in which direction y-value grow.
- PageOrigin
Gets the current page origin. Setting the origin is not yet implemented.
- PageSize
Gets the current size of the page in the current page units.
- PageUnit
Gets or sets the unit of measure used for page coordinates. CURRENTLY ONLY POINT IS IMPLEMENTED.
- PdfPage
Gets the PDF page that serves as drawing surface if PDF is rendered, or null if no such object exists.
- SmoothingMode
Gets or sets the smoothing mode.
- Transform
Gets the current transformation matrix. The transformation matrix cannot be set. Instead use Save/Restore or BeginContainer/EndContainer to save the state before Transform is called and later restore to the previous transform.
- Transformer
(Under construction. May change in future versions.)
Methods
- BeginContainer()
Saves a graphics container with the current state of this XGraphics and opens and uses a new graphics container.
- BeginContainer(XRect, XRect, XGraphicsUnit)
Saves a graphics container with the current state of this XGraphics and opens and uses a new graphics container.
- CreateMeasureContext(XSize, XGraphicsUnit, XPageDirection, RenderEvents?)
Creates the measure context. This is a graphics context created only for querying measures of text. Drawing on a measure context has no effect. Commit renderEvents to allow RenderTextEvent calls.
- Dispose()
Releases all resources used by this object. PDFsharp disposes XGraphics objects automatically. You must call Dispose if you want to create another XGraphics object or a PDFsharp Graphics DrawingContext for this page.
- DrawArc(XPen, XRect, double, double)
Draws an arc representing a portion of an ellipse.
- DrawArc(XPen, double, double, double, double, double, double)
Draws an arc representing a portion of an ellipse.
- DrawBezier(XPen, XPoint, XPoint, XPoint, XPoint)
Draws a Bézier spline defined by four points.
- DrawBezier(XPen, double, double, double, double, double, double, double, double)
Draws a Bézier spline defined by four points.
- DrawBeziers(XPen, XPoint[])
Draws a series of Bézier splines from an array of points.
- DrawClosedCurve(XBrush, XPoint[])
Draws a closed cardinal spline defined by an array of points.
- DrawClosedCurve(XBrush, XPoint[], XFillMode)
Draws a closed cardinal spline defined by an array of points.
- DrawClosedCurve(XBrush, XPoint[], XFillMode, double)
Draws a closed cardinal spline defined by an array of points.
- DrawClosedCurve(XPen?, XBrush?, XPoint[])
Draws a closed cardinal spline defined by an array of points.
- DrawClosedCurve(XPen?, XBrush?, XPoint[], XFillMode)
Draws a closed cardinal spline defined by an array of points.
- DrawClosedCurve(XPen?, XBrush?, XPoint[], XFillMode, double)
Draws a closed cardinal spline defined by an array of points.
- DrawClosedCurve(XPen, XPoint[])
Draws a closed cardinal spline defined by an array of points.
- DrawClosedCurve(XPen, XPoint[], double)
Draws a closed cardinal spline defined by an array of points.
- DrawCurve(XPen, XPoint[])
Draws a cardinal spline through a specified array of points.
- DrawCurve(XPen, XPoint[], double)
Draws a cardinal spline through a specified array of points using a specified tension.
- DrawCurve(XPen, XPoint[], int, int, double)
Draws a cardinal spline through a specified array of point using a specified tension. The drawing begins offset from the beginning of the array.
- DrawEllipse(XBrush, XRect)
Draws an ellipse defined by a bounding rectangle.
- DrawEllipse(XBrush, double, double, double, double)
Draws an ellipse defined by a bounding rectangle.
- DrawEllipse(XPen?, XBrush?, XRect)
Draws an ellipse defined by a bounding rectangle.
- DrawEllipse(XPen?, XBrush?, double, double, double, double)
Draws an ellipse defined by a bounding rectangle.
- DrawEllipse(XPen, XRect)
Draws an ellipse defined by a bounding rectangle.
- DrawEllipse(XPen, double, double, double, double)
Draws an ellipse defined by a bounding rectangle.
- DrawImage(XImage, XPoint)
Draws the specified image.
- DrawImage(XImage, XRect)
Draws the specified image.
- DrawImage(XImage, XRect, XRect, XGraphicsUnit)
Draws the specified image.
- DrawImage(XImage, double, double)
Draws the specified image.
- DrawImage(XImage, double, double, double, double)
Draws the specified image.
- DrawLine(XPen, XPoint, XPoint)
Draws a line connecting two XPoint structures.
- DrawLine(XPen, double, double, double, double)
Draws a line connecting the two points specified by coordinate pairs.
- DrawLines(XPen, XPoint[])
Draws a series of line segments that connect an array of points.
- DrawLines(XPen, double, double, params double[])
Draws a series of line segments that connect an array of x and y pairs.
- DrawPath(XBrush, XGraphicsPath)
Draws a graphical path.
- DrawPath(XPen?, XBrush?, XGraphicsPath)
Draws a graphical path.
- DrawPath(XPen, XGraphicsPath)
Draws a graphical path.
- DrawPie(XBrush, XRect, double, double)
Draws a pie defined by an ellipse.
- DrawPie(XBrush, double, double, double, double, double, double)
Draws a pie defined by an ellipse.
- DrawPie(XPen?, XBrush?, XRect, double, double)
Draws a pie defined by an ellipse.
- DrawPie(XPen?, XBrush?, double, double, double, double, double, double)
Draws a pie defined by an ellipse.
- DrawPie(XPen, XRect, double, double)
Draws a pie defined by an ellipse.
- DrawPie(XPen, double, double, double, double, double, double)
Draws a pie defined by an ellipse.
- DrawPolygon(XBrush, XPoint[], XFillMode)
Draws a polygon defined by an array of points.
- DrawPolygon(XPen?, XBrush?, XPoint[], XFillMode)
Draws a polygon defined by an array of points.
- DrawPolygon(XPen, XPoint[])
Draws a polygon defined by an array of points.
- DrawRectangle(XBrush, XRect)
Draws a rectangle.
- DrawRectangle(XBrush, double, double, double, double)
Draws a rectangle.
- DrawRectangle(XPen?, XBrush?, XRect)
Draws a rectangle.
- DrawRectangle(XPen?, XBrush?, double, double, double, double)
Draws a rectangle.
- DrawRectangle(XPen, XRect)
Draws a rectangle.
- DrawRectangle(XPen, double, double, double, double)
Draws a rectangle.
- DrawRectangles(XBrush, XRect[])
Draws a series of rectangles.
- DrawRectangles(XPen?, XBrush?, XRect[])
Draws a series of rectangles.
- DrawRectangles(XPen, XRect[])
Draws a series of rectangles.
- DrawRoundedRectangle(XBrush, XRect, XSize)
Draws a rectangle with rounded corners.
- DrawRoundedRectangle(XBrush, double, double, double, double, double, double)
Draws a rectangle with rounded corners.
- DrawRoundedRectangle(XPen?, XBrush?, XRect, XSize)
Draws a rectangle with rounded corners.
- DrawRoundedRectangle(XPen?, XBrush?, double, double, double, double, double, double)
Draws a rectangle with rounded corners.
- DrawRoundedRectangle(XPen, XRect, XSize)
Draws a rectangle with rounded corners.
- DrawRoundedRectangle(XPen, double, double, double, double, double, double)
Draws a rectangle with rounded corners.
- DrawString(string, XFont, XBrush, XPoint)
Draws the specified text string.
- DrawString(string, XFont, XBrush, XPoint, XStringFormat)
Draws the specified text string.
- DrawString(string, XFont, XBrush, XRect)
Draws the specified text string.
- DrawString(string, XFont, XBrush, XRect, XStringFormat)
Draws the specified text string.
- DrawString(string, XFont, XBrush, double, double)
Draws the specified text string.
- DrawString(string, XFont, XBrush, double, double, XStringFormat)
Draws the specified text string.
- EndContainer(XGraphicsContainer)
Closes the current graphics container and restores the state of this XGraphics to the state saved by a call to the BeginContainer method.
- FromForm(XForm)
Creates a new instance of the XGraphics class from a PdfSharp.Drawing.XForm object.
- FromImage(XImage, XGraphicsUnit, RenderEvents?)
Creates a new instance of the XGraphics class from a PdfSharp.Drawing.XImage object.
- FromImage(XImage, RenderEvents?)
Creates a new instance of the XGraphics class from a PdfSharp.Drawing.XForm object.
- FromPdfForm(XPdfForm)
Creates a new instance of the XGraphics class from a PdfSharp.Drawing.XPdfForm object.
- FromPdfPage(PdfPage)
Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object.
- FromPdfPage(PdfPage, XGraphicsPdfPageOptions)
Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object.
- FromPdfPage(PdfPage, XGraphicsPdfPageOptions, XGraphicsUnit)
Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object.
- FromPdfPage(PdfPage, XGraphicsPdfPageOptions, XGraphicsUnit, XPageDirection)
Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object.
- FromPdfPage(PdfPage, XGraphicsPdfPageOptions, XPageDirection)
Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object.
- FromPdfPage(PdfPage, XGraphicsUnit)
Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object.
- FromPdfPage(PdfPage, XPageDirection)
Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object.
- IntersectClip(XGraphicsPath)
Updates the clip region of this XGraphics to the intersection of the current clip region and the specified graphical path.
- IntersectClip(XRect)
Updates the clip region of this XGraphics to the intersection of the current clip region and the specified rectangle.
- MeasureString(string, XFont)
Measures the specified string when drawn with the specified font.
- MeasureString(string, XFont, XStringFormat)
Measures the specified string when drawn with the specified font.
- MultiplyTransform(XMatrix)
Multiplies the transformation matrix of this object and specified matrix.
- MultiplyTransform(XMatrix, XMatrixOrder)
Multiplies the transformation matrix of this object and specified matrix in the specified order.
- Restore()
Restores the state of this XGraphics object to the state before the most recently call of Save.
- Restore(XGraphicsState)
Restores the state of this XGraphics object to the state represented by the specified XGraphicsState object.
- RotateAtTransform(double, XPoint)
Applies the specified rotation operation to the transformation matrix of this object by prepending it to the object’s transformation matrix.
- RotateAtTransform(double, XPoint, XMatrixOrder)
Applies the specified rotation operation to the transformation matrix of this object by prepending it to the object’s transformation matrix.
- RotateTransform(double)
Applies the specified rotation operation to the transformation matrix of this object by prepending it to the object’s transformation matrix.
- RotateTransform(double, XMatrixOrder)
Applies the specified rotation operation to the transformation matrix of this object in the specified order. The angle unit of measure is degree.
- Save()
Saves the current state of this XGraphics object and identifies the saved state with the returned XGraphicsState object.
- ScaleAtTransform(double, double, XPoint)
Applies the specified scaling operation to the transformation matrix of this object by prepending it to the object’s transformation matrix.
- ScaleAtTransform(double, double, double, double)
Applies the specified scaling operation to the transformation matrix of this object by prepending it to the object’s transformation matrix.
- ScaleTransform(double)
Applies the specified scaling operation to the transformation matrix of this object by prepending it to the object’s transformation matrix.
- ScaleTransform(double, XMatrixOrder)
Applies the specified scaling operation to the transformation matrix of this object in the specified order.
- ScaleTransform(double, double)
Applies the specified scaling operation to the transformation matrix of this object by prepending it to the object’s transformation matrix.
- ScaleTransform(double, double, XMatrixOrder)
Applies the specified scaling operation to the transformation matrix of this object in the specified order.
- ShearTransform(double, double)
Applies the specified shearing operation to the transformation matrix of this object by prepending it to the object’s transformation matrix. ShearTransform is a synonym for SkewAtTransform. Parameter shearX specifies the horizontal skew which is measured in degrees counterclockwise from the y-axis. Parameter shearY specifies the vertical skew which is measured in degrees counterclockwise from the x-axis.
- ShearTransform(double, double, XMatrixOrder)
Applies the specified shearing operation to the transformation matrix of this object in the specified order. ShearTransform is a synonym for SkewAtTransform. Parameter shearX specifies the horizontal skew which is measured in degrees counterclockwise from the y-axis. Parameter shearY specifies the vertical skew which is measured in degrees counterclockwise from the x-axis.
- SkewAtTransform(double, double, XPoint)
Applies the specified shearing operation to the transformation matrix of this object by prepending it to the object’s transformation matrix. ShearTransform is a synonym for SkewAtTransform. Parameter shearX specifies the horizontal skew which is measured in degrees counterclockwise from the y-axis. Parameter shearY specifies the vertical skew which is measured in degrees counterclockwise from the x-axis.
- SkewAtTransform(double, double, double, double)
Applies the specified shearing operation to the transformation matrix of this object by prepending it to the object’s transformation matrix. ShearTransform is a synonym for SkewAtTransform. Parameter shearX specifies the horizontal skew which is measured in degrees counterclockwise from the y-axis. Parameter shearY specifies the vertical skew which is measured in degrees counterclockwise from the x-axis.
- TranslateTransform(double, double)
Applies the specified translation operation to the transformation matrix of this object by prepending it to the object’s transformation matrix.
- TranslateTransform(double, double, XMatrixOrder)
Applies the specified translation operation to the transformation matrix of this object in the specified order.
- WriteComment(string)
Writes a comment to the output stream. Comments have no effect on the rendering of the output. They may be useful to mark a position in a content stream of a page in a PDF document.