Search
Shape Constructor (CreatePathDelegate, String)
See Also
 





Initializes a new instance of the Shape class with the specified outline delegate and id.

Namespace: MindFusion.Diagramming
Assembly: MindFusion.Diagramming

 Syntax

C#  Copy Code

public Shape (
    CreatePathDelegate outlineDelegate,
    string id
)

Visual Basic  Copy Code

Public New ( _
    outlineDelegate As CreatePathDelegate, _
    id As String _
)

 Parameters

outlineDelegate
A delegate called to generate GraphicsPath objects representing the shape outline.
id

The string identifier of the new shape.

 Example

This example creates a triangular shape:

C#  Copy Code

Shape shape = new Shape(CreatePath, "my shape");

IGraphicsPath CreatePath(Rect shapeData)
{
    var path = GraphicsFactory.CreatePath();
    path.AddLine(10, 0, shapeData.Width, 10);
    path.AddLine(shapeData.Width, 10, shapeData.Width / 2, shapeData.Height);
    path.CloseFigure();
    return path;
}

 See Also