Back to Devexpress

Custom Shapes Tutorial. Step 4: Load a Shape to the Repository

vcl-163015-expressflowchart-tutorials-how-to-create-custom-xml-based-shapes-step-4-load-a-shape-to-the-repository.md

latest1.7 KB
Original Source

Custom Shapes Tutorial. Step 4: Load a Shape to the Repository

  • Dec 28, 2020

In the previous step, you specified optional settings of each shape.

This step demonstrates how to add the shapes to the control’s repository.

A code sample of each shape is shown here.

You can load custom XML-based shapes from a file or stream. To add the shape to a predefined or existing stencil, pass its unique identifier as the AStencilID parameter. If the repository has no specified stencil, the procedure creates a new shape category, the AStencilCaption parameter defines its name and appends the shape(s) to it.

The following code snippet demonstrates how to load custom shapes from a file:

delphi
dxFlowChart1.Repository.LoadShapesFromFile('C:\ShapeSources\MyShapes.xml', 'ACustomStencil', 'Custom Shapes');

The result is shown below.

See Also

Custom Shape Structure

Custom Shapes Tutorial. Complete Code Examples