Search
Brush and Pen Classes

MindFusion.Diagramming defines Brush and Pen classes to represent drawing attributes of shape backgrounds and outlines. Instances of those classes can be assigned to the Brush and Pen properties of each diagram element. There are five specific brush classes that inherit the abstract class Brush, namely HatchBrush, LinearGradientBrush, PathGradientBrush, SolidBrush and TextureBrush.

You can set default pen and brush properties like this:

C#  Copy Code

diagram.ShapeBrush = new MindFusion.Drawing.LinearGradientBrush(
    Color.Yellow, Color.BurlyWood, 20);

MindFusion.Drawing.Brush penBrush = new MindFusion.Drawing.LinearGradientBrush(
    Color.Bisque, Color.Blue, 0);
diagram.ShapePen = new MindFusion.Drawing.Pen(penBrush);

After that code runs, every new shape node created will draw with specified pen and gradient background.