WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class Canvas - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class Canvas

    Represents the canvas that contains shapes.

    Inheritance
    System.Object
    EntityBase
    XDLSSerializableBase
    WidgetBase
    ParagraphItem
    Canvas
    Implements
    IXDLSSerializable
    ICanvas
    IParagraphItem
    IEntityBase
    ISplitLeafWidget
    ILeafWidget
    IWidget
    Inherited Members
    ParagraphItem.m_iStartIndex
    ParagraphItem.SetOwnerParagraph(IParagraph, Int32)
    ParagraphItem.OwnerParagraph
    ParagraphItem.StartIndex
    WidgetBase.m_layoutInfo
    WidgetBase.IWidget.Draw(CustomGraphics, LayoutedWidget)
    WidgetBase.DrawImpl(CustomGraphics, LayoutedWidget)
    WidgetBase.IWidget.LayoutInfo
    XDLSSerializableBase.m_id
    XDLSSerializableBase.IXDLSSerializable.WriteXmlAttributes(IXDLSAttributeWriter)
    XDLSSerializableBase.IXDLSSerializable.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.IXDLSSerializable.ReadXmlAttributes(IXDLSAttributeReader)
    XDLSSerializableBase.IXDLSSerializable.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.IXDLSSerializable.RestoreReference(String, Int32)
    XDLSSerializableBase.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.RestoreReference(String, Int32)
    XDLSSerializableBase.IXDLSSerializable.XDLSHolder
    XDLSSerializableBase.XDLSHolder
    EntityBase.SetOwner(IEntityBase)
    EntityBase.Owner
    EntityBase.Document
    EntityBase.DocumentEx
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.DLS
    Assembly: Syncfusion.DLS.Base.dll
    Syntax
    public class Canvas : ParagraphItem, IXDLSSerializable, ICanvas, IParagraphItem, IEntityBase, ISplitLeafWidget, ILeafWidget, IWidget
    Remarks

    Supported by Essential PDF only.

    Constructors

    Canvas(Document)

    Initializing constructor

    Declaration
    public Canvas(Document doc)
    Parameters
    Type Name Description
    Document doc

    Properties

    BorderColor

    Gets / sets border color

    Declaration
    public Color BorderColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    Height

    Gets / sets canvas height

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

    Shapes

    Gets canvas shapes collection.

    Declaration
    public ShapeCollection Shapes { get; }
    Property Value
    Type Description
    ShapeCollection

    Size

    Gets / sets size of the canvas.

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

    Width

    Gets / sets canvas width

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

    Methods

    AddArc()

    Creates Arc shape and adds it to collection.

    Declaration
    public ArcShape AddArc()
    Returns
    Type Description
    ArcShape

    Created Arc shape.

    Remarks

    Coordinates of this shape needs to be set to correctly display this shape on the canvas.

    AddBezier()

    Creates Bezier curve shape and adds it to collection.

    Declaration
    public BezierShape AddBezier()
    Returns
    Type Description
    BezierShape

    Created Bezier curve shape.

    Remarks

    Coordinates of this shape needs to be set to correctly display this shape on the canvas.

    AddEllipse()

    Creates Ellipse shape and adds it to collection.

    Declaration
    public EllipseShape AddEllipse()
    Returns
    Type Description
    EllipseShape

    Created Ellipse shape.

    Remarks

    Coordinates of this shape needs to be set to correctly display this shape on the canvas.

    AddImage(Image)

    Creates Image shape and adds it to collection.

    Declaration
    public ImageShape AddImage(Image image)
    Parameters
    Type Name Description
    System.Drawing.Image image

    Image object.

    Returns
    Type Description
    ImageShape

    Created Image shape.

    Remarks

    Coordinates of this shape needs to be set to correctly display this shape on the canvas.

    AddLine()

    Creates Line shape and adds it to collection.

    Declaration
    public LineShape AddLine()
    Returns
    Type Description
    LineShape

    Created Line shape.

    Remarks

    Coordinates of this shape needs to be set to correctly display this shape on the canvas.

    AddPath()

    Creates Path shape and adds it to collection.

    Declaration
    public PathShape AddPath()
    Returns
    Type Description
    PathShape

    Created Path shape.

    Remarks

    Coordinates of this shape needs to be set to correctly display this shape on the canvas.

    AddPie()

    Creates Pie shape and adds it to collection.

    Declaration
    public PieShape AddPie()
    Returns
    Type Description
    PieShape

    Created Pie shape.

    Remarks

    Coordinates of this shape needs to be set to correctly display this shape on the canvas.

    AddPolygon()

    Creates Polygon shape and adds it to collection.

    Declaration
    public PolygonShape AddPolygon()
    Returns
    Type Description
    PolygonShape

    Created Polygon shape.

    Remarks

    Coordinates of this shape needs to be set to correctly display this shape on the canvas.

    AddRectangle()

    Creates Rectangle shape and adds it to collection.

    Declaration
    public RectangleShape AddRectangle()
    Returns
    Type Description
    RectangleShape

    Created Rectangle shape.

    Remarks

    Coordinates of this shape needs to be set to correctly display this shape on the canvas.

    AddShape(ShapeType)

    Adds a new shape to the canvas.

    Declaration
    public Shape AddShape(ShapeType shapeType)
    Parameters
    Type Name Description
    ShapeType shapeType
    Returns
    Type Description
    Shape

    AddText(String)

    Creates Text shape and adds it to collection.

    Declaration
    public TextShape AddText(string text)
    Parameters
    Type Name Description
    System.String text

    Text data of the shape.

    Returns
    Type Description
    TextShape

    Created Text shape.

    Remarks

    Coordinates of this shape needs to be set to correctly display this shape on the canvas.

    Clone(IParagraph)

    Clones itself.

    Declaration
    public override IParagraphItem Clone(IParagraph paragraph)
    Parameters
    Type Name Description
    IParagraph paragraph
    Returns
    Type Description
    IParagraphItem
    Overrides
    ParagraphItem.Clone(IParagraph)

    CreateLayoutInfo()

    Declaration
    protected override void CreateLayoutInfo()
    Overrides
    WidgetBase.CreateLayoutInfo()

    Draw(CustomGraphics, LayoutedWidget)

    Declaration
    public virtual void Draw(CustomGraphics cg, LayoutedWidget ltWidget)
    Parameters
    Type Name Description
    CustomGraphics cg
    LayoutedWidget ltWidget

    InitXDLSHolder()

    Declaration
    protected override void InitXDLSHolder()
    Overrides
    XDLSSerializableBase.InitXDLSHolder()

    Measure(CustomGraphics)

    Declaration
    public SizeF Measure(CustomGraphics graphics)
    Parameters
    Type Name Description
    CustomGraphics graphics
    Returns
    Type Description
    System.Drawing.SizeF

    ReadXmlAttributes(IXDLSAttributeReader)

    Overloaded. Reads XML attributes.

    Declaration
    protected override void ReadXmlAttributes(IXDLSAttributeReader reader)
    Parameters
    Type Name Description
    IXDLSAttributeReader reader

    Reader object.

    Overrides
    ParagraphItem.ReadXmlAttributes(IXDLSAttributeReader)

    SplitByOffset(CustomGraphics, SizeF)

    Declaration
    public ISplitLeafWidget[] SplitByOffset(CustomGraphics graphics, SizeF offset)
    Parameters
    Type Name Description
    CustomGraphics graphics
    System.Drawing.SizeF offset
    Returns
    Type Description
    ISplitLeafWidget[]

    WriteXmlAttributes(IXDLSAttributeWriter)

    Declaration
    protected override void WriteXmlAttributes(IXDLSAttributeWriter writer)
    Parameters
    Type Name Description
    IXDLSAttributeWriter writer
    Overrides
    ParagraphItem.WriteXmlAttributes(IXDLSAttributeWriter)

    Implements

    IXDLSSerializable
    ICanvas
    IParagraphItem
    IEntityBase
    ISplitLeafWidget
    ILeafWidget
    IWidget
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved