Search Results for

    Show / Hide Table of Contents

    Class SvgGraphics

    Drawing objects to a svg

    Inheritance
    System.Object
    SvgGraphics
    Implements
    FastReport.IGraphics
    Namespace: FastReport
    Assembly: FastReport.dll
    Syntax
    public class SvgGraphics : object, IGraphics, IDisposable

    Constructors

    SvgGraphics(XmlDocument)

    Initialize a new Graphics for SVG, it's rendered to xml, layer by layer, not one image, set the Size of this graphics in Size property

    Declaration
    public SvgGraphics(XmlDocument xmlDocument)
    Parameters
    Type Name Description
    XmlDocument xmlDocument

    Properties

    Attributes

    For setting namespace, clear all attributes on setting, therefore use this property before setting other svg options

    Declaration
    public IEnumerable<KeyValuePair<string, string>> Attributes { get; set; }
    Property Value
    Type Description
    IEnumerable<KeyValuePair<System.String, System.String>>

    Clip

    Gets or sets the clip region.

    Declaration
    public Region Clip { get; set; }
    Property Value
    Type Description
    Region

    CompositingQuality

    Gets or sets compositing quality. Not used in this class.

    Declaration
    public CompositingQuality CompositingQuality { get; set; }
    Property Value
    Type Description
    CompositingQuality

    DpiX

    Gets horizontal dpi.

    Declaration
    public float DpiX { get; }
    Property Value
    Type Description
    System.Single

    DpiY

    Gets vertical dpi.

    Declaration
    public float DpiY { get; }
    Property Value
    Type Description
    System.Single

    EmbeddedImages

    Determines if images should be embedded.

    Declaration
    public bool EmbeddedImages { get; set; }
    Property Value
    Type Description
    System.Boolean

    Graphics

    Gets graphics instance.

    Declaration
    public Graphics Graphics { get; }
    Property Value
    Type Description
    Graphics

    ImageFilePrefix

    Gets or sets image file prefix.

    Declaration
    public string ImageFilePrefix { get; set; }
    Property Value
    Type Description
    System.String

    InterpolationMode

    Gets or sets interpolation mode. Not used in this class.

    Declaration
    public InterpolationMode InterpolationMode { get; set; }
    Property Value
    Type Description
    InterpolationMode

    IsClipEmpty

    Determines if the clip is empty.

    Declaration
    public bool IsClipEmpty { get; }
    Property Value
    Type Description
    System.Boolean

    PageUnit

    Gets or sets the page unit.

    Declaration
    public GraphicsUnit PageUnit { get; set; }
    Property Value
    Type Description
    GraphicsUnit

    PrefixStyle

    Sets or gets prefix for style and object ids

    Declaration
    public string PrefixStyle { get; set; }
    Property Value
    Type Description
    System.String

    Size

    Gets or sets the size.

    Declaration
    public SizeF Size { get; set; }
    Property Value
    Type Description
    SizeF

    SmoothingMode

    Gets or sets smoothing mode. Not used in this class.

    Declaration
    public SmoothingMode SmoothingMode { get; set; }
    Property Value
    Type Description
    SmoothingMode

    SvgImageFormat

    Gets or sets images format.

    Declaration
    public SVGImageFormat SvgImageFormat { get; set; }
    Property Value
    Type Description
    SVGImageFormat

    TextRenderingHint

    Gets or sets text rendering hint. Not used in this class.

    Declaration
    public TextRenderingHint TextRenderingHint { get; set; }
    Property Value
    Type Description
    TextRenderingHint

    Transform

    Gets or sets the transformation matrix.

    Declaration
    public Drawing2D.Matrix Transform { get; set; }
    Property Value
    Type Description
    System.Drawing.Drawing2D.Matrix

    ViewBox

    Gets or sets the viewbox bounds.

    Declaration
    public RectangleF ViewBox { get; set; }
    Property Value
    Type Description
    RectangleF

    ViewPort

    Gets or sets the viewport bounds.

    Declaration
    public RectangleF ViewPort { get; set; }
    Property Value
    Type Description
    RectangleF

    XmlDocument

    Gets xml document.

    Declaration
    public XmlDocument XmlDocument { get; }
    Property Value
    Type Description
    XmlDocument

    Methods

    Dispose()

    Disposes the object.

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Disposes the object.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true if manual dispose is called.

    DrawArc(Pen, Single, Single, Single, Single, Single, Single)

    Draws the arc.

    Declaration
    public void DrawArc(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    System.Single x

    The center X coordinate.

    System.Single y

    The center Y coordinate.

    System.Single width

    The ellipse width.

    System.Single height

    The ellipse height.

    System.Single startAngle

    The start angle.

    System.Single sweepAngle

    The sweep angle.

    DrawCurve(Pen, PointF[], Int32, Int32, Single)

    Draws the curve.

    Declaration
    public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments, float tension)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    PointF[] points

    The array of points.

    System.Int32 offset

    The offset.

    System.Int32 numberOfSegments

    The number of segments.

    System.Single tension

    The tension.

    DrawEllipse(Pen, RectangleF)

    Draws the ellipse.

    Declaration
    public void DrawEllipse(Pen pen, RectangleF rect)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    RectangleF rect

    The bounds rect.

    DrawEllipse(Pen, Single, Single, Single, Single)

    Draws the ellipse.

    Declaration
    public void DrawEllipse(Pen pen, float left, float top, float width, float height)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    System.Single left

    The X coordinate of upper-left corner.

    System.Single top

    The Y coordinate of upper-left corner.

    System.Single width

    The ellipse width.

    System.Single height

    The ellipse height.

    DrawImage(Image, PointF[])

    Draws the image using 3 points provided.

    Declaration
    public void DrawImage(Image image, PointF[] points)
    Parameters
    Type Name Description
    Image image

    The image.

    PointF[] points

    Array of points (3 points exactly).

    DrawImage(Image, Rectangle, Int32, Int32, Int32, Int32, GraphicsUnit, ImageAttributes)

    Draws the image.

    Declaration
    public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr)
    Parameters
    Type Name Description
    Image image

    The image.

    Rectangle destRect

    The destination rect.

    System.Int32 srcX

    The source X coordinate.

    System.Int32 srcY

    The source Y coordinate.

    System.Int32 srcWidth

    The source width.

    System.Int32 srcHeight

    The source height.

    GraphicsUnit srcUnit

    The source units.

    ImageAttributes imageAttr

    The image attributes.

    DrawImage(Image, Rectangle, Single, Single, Single, Single, GraphicsUnit, ImageAttributes)

    Draws the image.

    Declaration
    public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs)
    Parameters
    Type Name Description
    Image image

    The image.

    Rectangle destRect

    The destination rect.

    System.Single srcX

    The source X coordinate.

    System.Single srcY

    The source Y coordinate.

    System.Single srcWidth

    The source width.

    System.Single srcHeight

    The source height.

    GraphicsUnit srcUnit

    The source units.

    ImageAttributes imageAttrs

    The image attributes.

    DrawImage(Image, RectangleF)

    Draws the image.

    Declaration
    public void DrawImage(Image image, RectangleF rect)
    Parameters
    Type Name Description
    Image image

    The image.

    RectangleF rect

    The destination rect.

    DrawImage(Image, RectangleF, RectangleF, GraphicsUnit)

    Draws the image.

    Declaration
    public void DrawImage(Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit)
    Parameters
    Type Name Description
    Image image

    The image.

    RectangleF destRect

    The destination rect.

    RectangleF srcRect

    The source rect.

    GraphicsUnit srcUnit

    The source units.

    DrawImage(Image, Single, Single)

    Draws the image.

    Declaration
    public void DrawImage(Image image, float x, float y)
    Parameters
    Type Name Description
    Image image

    The image.

    System.Single x

    The destination X coordinate

    System.Single y

    The destination Y coordinate

    DrawImage(Image, Single, Single, Single, Single)

    Draws the image.

    Declaration
    public void DrawImage(Image image, float x, float y, float width, float height)
    Parameters
    Type Name Description
    Image image

    The image.

    System.Single x

    The destination X coordinate.

    System.Single y

    The destination Y coordinate.

    System.Single width

    The destination width.

    System.Single height

    The destination height.

    DrawImageUnscaled(Image, Rectangle)

    Draws the image as is w/o scaling.

    Declaration
    public void DrawImageUnscaled(Image image, Rectangle rect)
    Parameters
    Type Name Description
    Image image

    The image.

    Rectangle rect

    The destination rect.

    DrawLine(Pen, PointF, PointF)

    Draws the line.

    Declaration
    public void DrawLine(Pen pen, PointF p1, PointF p2)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    PointF p1

    The start point.

    PointF p2

    The end point.

    DrawLine(Pen, Single, Single, Single, Single)

    Draws the line.

    Declaration
    public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    System.Single x1

    The X1 coordinate.

    System.Single y1

    The Y1 coordinate.

    System.Single x2

    The X2 coordinate.

    System.Single y2

    The Y2 coordinate.

    DrawLines(Pen, PointF[])

    Draws lines.

    Declaration
    public void DrawLines(Pen pen, PointF[] points)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    PointF[] points

    The array of points.

    DrawPath(Pen, GraphicsPath)

    Draws the path.

    Declaration
    public void DrawPath(Pen outlinePen, GraphicsPath path)
    Parameters
    Type Name Description
    Pen outlinePen

    The path outline pen.

    GraphicsPath path

    The path.

    DrawPie(Pen, Single, Single, Single, Single, Single, Single)

    Draws the pie.

    Declaration
    public void DrawPie(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    System.Single x

    The X coordinate.

    System.Single y

    The Y coordinate.

    System.Single width

    The width.

    System.Single height

    The height.

    System.Single startAngle

    The start angle.

    System.Single sweepAngle

    The sweep angle.

    DrawPolygon(Pen, Point[])

    Draws the polygon.

    Declaration
    public void DrawPolygon(Pen pen, Point[] points)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    Point[] points

    The array of points.

    DrawPolygon(Pen, PointF[])

    Draws the polygon.

    Declaration
    public void DrawPolygon(Pen pen, PointF[] points)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    PointF[] points

    The array of points.

    DrawRectangle(Pen, Rectangle)

    Draws the rectangle.

    Declaration
    public void DrawRectangle(Pen pen, Rectangle rect)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    Rectangle rect

    The bounds rect.

    DrawRectangle(Pen, Single, Single, Single, Single)

    Draws the rectangle.

    Declaration
    public void DrawRectangle(Pen pen, float left, float top, float width, float height)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    System.Single left

    The left coordinate.

    System.Single top

    The top coordinate.

    System.Single width

    The width,

    System.Single height

    The height.

    DrawString(String, Font, Brush, PointF, StringFormat)

    Draws the text.

    Declaration
    public void DrawString(string text, Font font, Brush brush, PointF point, StringFormat format)
    Parameters
    Type Name Description
    System.String text

    Text to draw.

    Font font

    The font.

    Brush brush

    The text brush.

    PointF point

    The point.

    StringFormat format

    The string format.

    DrawString(String, Font, Brush, RectangleF)

    Draws the text.

    Declaration
    public void DrawString(string text, Font font, Brush brush, RectangleF rect)
    Parameters
    Type Name Description
    System.String text

    Text to draw.

    Font font

    The font.

    Brush brush

    The text brush.

    RectangleF rect

    The bounds rect.

    DrawString(String, Font, Brush, RectangleF, StringFormat)

    Draws the text.

    Declaration
    public void DrawString(string text, Font font, Brush brush, RectangleF rect, StringFormat format)
    Parameters
    Type Name Description
    System.String text

    Text to draw.

    Font font

    The font.

    Brush brush

    The text brush.

    RectangleF rect

    The bounds rect.

    StringFormat format

    The string format.

    DrawString(String, Font, Brush, Single, Single)

    Draws the text.

    Declaration
    public void DrawString(string text, Font font, Brush brush, float left, float top)
    Parameters
    Type Name Description
    System.String text

    Text to draw.

    Font font

    The font.

    Brush brush

    The text brush.

    System.Single left

    The left coordinate.

    System.Single top

    The top coordinate.

    DrawString(String, Font, Brush, Single, Single, StringFormat)

    Draws the text.

    Declaration
    public void DrawString(string text, Font font, Brush brush, float left, float top, StringFormat format)
    Parameters
    Type Name Description
    System.String text

    Text to draw.

    Font font

    The font.

    Brush brush

    The text brush.

    System.Single left

    The left coordinate.

    System.Single top

    The top coordinate.

    StringFormat format

    The string format.

    FillAndDrawEllipse(Pen, Brush, RectangleF)

    Fills and draws the ellipse.

    Declaration
    public void FillAndDrawEllipse(Pen pen, Brush brush, RectangleF rect)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    Brush brush

    The brush.

    RectangleF rect

    The bounds rect.

    FillAndDrawEllipse(Pen, Brush, Single, Single, Single, Single)

    Fills and draws the ellipse.

    Declaration
    public void FillAndDrawEllipse(Pen pen, Brush brush, float left, float top, float width, float height)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    Brush brush

    The brush.

    System.Single left

    The X coordinate of upper-left corner.

    System.Single top

    The Y coordinate of upper-left corner.

    System.Single width

    The ellipse width.

    System.Single height

    The ellipse height.

    FillAndDrawPath(Pen, Brush, GraphicsPath)

    Fills and draws the path.

    Declaration
    public void FillAndDrawPath(Pen pen, Brush brush, GraphicsPath path)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    Brush brush

    The brush.

    GraphicsPath path

    The path.

    FillAndDrawPolygon(Pen, Brush, Point[])

    Fills and draws the polygon.

    Declaration
    public void FillAndDrawPolygon(Pen pen, Brush brush, Point[] points)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    Brush brush

    The brush.

    Point[] points

    The points array.

    FillAndDrawPolygon(Pen, Brush, PointF[])

    Fills and draws the polygon.

    Declaration
    public void FillAndDrawPolygon(Pen pen, Brush brush, PointF[] points)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    Brush brush

    The brush.

    PointF[] points

    The points array.

    FillAndDrawRectangle(Pen, Brush, Single, Single, Single, Single)

    Fills and draws the rectangle.

    Declaration
    public void FillAndDrawRectangle(Pen pen, Brush brush, float left, float top, float width, float height)
    Parameters
    Type Name Description
    Pen pen

    The pen.

    Brush brush

    The brush.

    System.Single left

    The left coordinate.

    System.Single top

    The top coordinate.

    System.Single width

    The width,

    System.Single height

    The height.

    FillEllipse(Brush, RectangleF)

    Fills the ellipse.

    Declaration
    public void FillEllipse(Brush brush, RectangleF rect)
    Parameters
    Type Name Description
    Brush brush

    The brush.

    RectangleF rect

    The bounds rect.

    FillEllipse(Brush, Single, Single, Single, Single)

    Fills the ellipse.

    Declaration
    public void FillEllipse(Brush brush, float left, float top, float width, float height)
    Parameters
    Type Name Description
    Brush brush

    The brush.

    System.Single left

    The X coordinate of upper-left corner.

    System.Single top

    The Y coordinate of upper-left corner.

    System.Single width

    The ellipse width.

    System.Single height

    The ellipse height.

    FillPath(Brush, GraphicsPath)

    Fills the path.

    Declaration
    public void FillPath(Brush brush, GraphicsPath path)
    Parameters
    Type Name Description
    Brush brush

    The brush.

    GraphicsPath path

    The path.

    FillPie(Brush, Single, Single, Single, Single, Single, Single)

    Fills the pie.

    Declaration
    public void FillPie(Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    Brush brush

    The brush.

    System.Single x

    The X coordinate.

    System.Single y

    The Y coordinate.

    System.Single width

    The width.

    System.Single height

    The height.

    System.Single startAngle

    The start angle.

    System.Single sweepAngle

    The sweep angle.

    FillPolygon(Brush, Point[])

    Fills the polygon.

    Declaration
    public void FillPolygon(Brush brush, Point[] points)
    Parameters
    Type Name Description
    Brush brush

    The brush.

    Point[] points

    The array of points.

    FillPolygon(Brush, PointF[])

    Fills the polygon.

    Declaration
    public void FillPolygon(Brush brush, PointF[] points)
    Parameters
    Type Name Description
    Brush brush

    The brush.

    PointF[] points

    The array of points.

    FillRectangle(Brush, RectangleF)

    Fills the rectangle.

    Declaration
    public void FillRectangle(Brush brush, RectangleF rect)
    Parameters
    Type Name Description
    Brush brush

    The brush.

    RectangleF rect

    The bounds rect.

    FillRectangle(Brush, Single, Single, Single, Single)

    Fills the rectangle.

    Declaration
    public void FillRectangle(Brush brush, float left, float top, float width, float height)
    Parameters
    Type Name Description
    Brush brush

    The brush.

    System.Single left

    The left coordinate.

    System.Single top

    The top coordinate.

    System.Single width

    The width,

    System.Single height

    The height.

    FillRegion(Brush, Region)

    Fills the region.

    Declaration
    public void FillRegion(Brush brush, Region region)
    Parameters
    Type Name Description
    Brush brush

    The brush.

    Region region

    The region.

    IsVisible(RectangleF)

    Determines if the rectangle is visible.

    Declaration
    public bool IsVisible(RectangleF rect)
    Parameters
    Type Name Description
    RectangleF rect

    The rect.

    Returns
    Type Description
    System.Boolean

    Always true for this kind of graphics.

    MeasureCharacterRanges(String, Font, RectangleF, StringFormat)

    Measures the text.

    Declaration
    public Region[] MeasureCharacterRanges(string text, Font font, RectangleF textRect, StringFormat format)
    Parameters
    Type Name Description
    System.String text

    The text.

    Font font

    The font.

    RectangleF textRect

    The bounds rect.

    StringFormat format

    The string format.

    Returns
    Type Description
    Region[]

    Array of Region objects.

    MeasureString(String, Font)

    Measures the text.

    Declaration
    public SizeF MeasureString(string text, Font font)
    Parameters
    Type Name Description
    System.String text

    The text.

    Font font

    The font.

    Returns
    Type Description
    SizeF

    The size of text.

    MeasureString(String, Font, SizeF)

    Measures the text.

    Declaration
    public SizeF MeasureString(string text, Font font, SizeF size)
    Parameters
    Type Name Description
    System.String text

    The text.

    Font font

    The font.

    SizeF size

    The size of layout area.

    Returns
    Type Description
    SizeF

    The size of text.

    MeasureString(String, Font, SizeF, StringFormat)

    Measures the text.

    Declaration
    public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat format)
    Parameters
    Type Name Description
    System.String text

    The text.

    Font font

    The font.

    SizeF layoutArea

    The size of layout area.

    StringFormat format

    The string format.

    Returns
    Type Description
    SizeF

    The size of text.

    MeasureString(String, Font, SizeF, StringFormat, out Int32, out Int32)

    Determines the amount of text fit in the area provided.

    Declaration
    public void MeasureString(string text, Font font, SizeF size, StringFormat format, out int charsFit, out int linesFit)
    Parameters
    Type Name Description
    System.String text

    The text.

    Font font

    The font.

    SizeF size

    The size of layout area.

    StringFormat format

    The string format.

    System.Int32 charsFit

    The number of characters fit in the area.

    System.Int32 linesFit

    The number of lines fit in the area.

    MeasureString(String, Font, Int32, StringFormat)

    Measures the text.

    Declaration
    public SizeF MeasureString(string text, Font font, int width, StringFormat format)
    Parameters
    Type Name Description
    System.String text

    The text.

    Font font

    The font.

    System.Int32 width

    The width of layout area.

    StringFormat format

    The string format.

    Returns
    Type Description
    SizeF

    The size of text.

    MultiplyTransform(Drawing2D.Matrix, MatrixOrder)

    Performs multiply trasnform.

    Declaration
    public void MultiplyTransform(Drawing2D.Matrix matrix, MatrixOrder order)
    Parameters
    Type Name Description
    System.Drawing.Drawing2D.Matrix matrix

    The transformation matrix.

    MatrixOrder order

    The order.

    ResetClip()

    Resets the clip.

    Declaration
    public void ResetClip()

    Restore(IGraphicsState)

    Restores the graphics state.

    Declaration
    public void Restore(IGraphicsState state)
    Parameters
    Type Name Description
    FastReport.IGraphicsState state

    The state object.

    RotateTransform(Single)

    Performs rotate transform.

    Declaration
    public void RotateTransform(float angle)
    Parameters
    Type Name Description
    System.Single angle

    The angle.

    Save()

    Saves the graphics state.

    Declaration
    public IGraphicsState Save()
    Returns
    Type Description
    FastReport.IGraphicsState

    The state object.

    ScaleTransform(Single, Single)

    Performs scale transform.

    Declaration
    public void ScaleTransform(float scaleX, float scaleY)
    Parameters
    Type Name Description
    System.Single scaleX

    Scale by X.

    System.Single scaleY

    Scale by Y.

    SetClip(GraphicsPath, CombineMode)

    Sets the clip using combine mode.

    Declaration
    public void SetClip(GraphicsPath path, CombineMode combineMode)
    Parameters
    Type Name Description
    GraphicsPath path

    The clip path.

    CombineMode combineMode

    The combine mode.

    SetClip(RectangleF)

    Sets the clip.

    Declaration
    public void SetClip(RectangleF rect)
    Parameters
    Type Name Description
    RectangleF rect

    The clip rectangle.

    SetClip(RectangleF, CombineMode)

    Sets the clip using combine mode.

    Declaration
    public void SetClip(RectangleF rect, CombineMode combineMode)
    Parameters
    Type Name Description
    RectangleF rect

    The clip rectangle.

    CombineMode combineMode

    The combine mode.

    TranslateTransform(Single, Single)

    Performs translate transform.

    Declaration
    public void TranslateTransform(float left, float top)
    Parameters
    Type Name Description
    System.Single left

    X offset.

    System.Single top

    Y offset.

    Implements

    FastReport.IGraphics
    Back to top © 1998-2026 Copyright Fast Reports Inc.