This is a migrated thread and some comments may be shown as answers.

How to set Geometry of a custom shape from code behind?

2 Answers 136 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Dilsah
Top achievements
Rank 1
Dilsah asked on 10 May 2012, 12:27 PM
I understand that in order to set the Geometry i need to :  

RadDiagramShape shapeCloud = new RadDiagramShape()
    {
        Width = 180,
        Height = 100,
        Position = new Point() { X = 100, Y = 100},
        Content = "Cloud"
    };
    shapeCloud.Geometry = ShapeFactory.GetShapeGeometry(CommonShapeType.CloudShape);
But what i really want is something like :
    shapeCloud.Geometry = "M16.35,6.39 C16.28,7.36 12.26,20.45 12.26,20.45 L20.56,20.45 C20.56,20.45 16.64,7.54 16.53,6.39 z M12.30,0.50 L20.97,0.50 L32.50,33.50 L24.54,33.50 L22.23,26.16 L10.70,26.16 L8.42,33.50 L0.50,33.50 z"
Is there a way to do that?
Thanks


2 Answers, 1 is accepted

Sort by
0
Accepted
Francois Vanderseypen
Top achievements
Rank 2
answered on 10 May 2012, 01:15 PM

var geo = GeometryParser.GetGeometry("M16.35,6.39 C16.28,7.36 12.26,20.45 12.26,20.45 L20.56,20.45 C20.56,20.45 16.64,7.54 16.53,6.39 z M12.30,0.50 L20.97,0.50 L32.50,33.50 L24.54,33.50 L22.23,26.16 L10.70,26.16 L8.42,33.50 L0.50,33.50 z");
var shape = diagram.AddShape("", geo, new Point(10, 50));


Will render the letter 'A' in your diagram.

Fr.
0
Dilsah
Top achievements
Rank 1
answered on 10 May 2012, 01:20 PM
Thanks a lot!!
Tags
Diagram
Asked by
Dilsah
Top achievements
Rank 1
Answers by
Francois Vanderseypen
Top achievements
Rank 2
Dilsah
Top achievements
Rank 1
Share this question
or