Nevron Forum

Custom ArrowheadShape

https://www.nevron.com/Forum/Topic4157.aspx

By Dennis Müller - Thursday, September 9, 2010

Hi,

I am trying to draw a vertical line with horizontal bars at the end. It seems that there is no predefined shape for that and I did not find hints how to add a custom shape for this purpose. I know how to set an NArrowheadStyle:

new NArrowheadStyle(ArrowheadShape.Custom, customShapeName, size, fillstyle, stroke);

And I guess that I have to add a Shape with a name somewhere and place the name in "customShapeName". But I have no Idea how to do this. Can anybody point me to the right documents or post some short codeparts?

Regards,

Dennis
By Nevron Support - Friday, September 10, 2010

Hi Dennis,

The following is a simple example of how to apply custom arrowhead style:

 

NRectangleShape rect = new NRectangleShape(0, 0, 5, 5);

rect.Name = "Rect";

document.ArrowheadShapeStencil.AddChild(rect);

NStyle.SetStartArrowheadStyle(line, new NArrowheadStyle(ArrowheadShape.Custom, "Rect",

      new NSizeL(5, 5), new NColorFillStyle(KnownArgbColorValue.Red), null));

 

By Dennis Müller - Friday, September 10, 2010

Thanks.

This piece of code was exactly the information I needed.

Regards,

Dennis