This property sets whether or not the custom brush is enabled.
Property Value
True: The custom brush is enabled
False: The custom brush is not enabled
Default value is False
Explanation
The CustomBrushEnabled property sets whether or not the custom brush is enabled.
To enable the custom brush, set this property and the Fill property to True.
By setting this property to True, not only is the custom brush enabled for drawing, but the custom brush can be saved into an annotation file and loaded from an annotation file. Even if the object is drawn and read with CustomBrushEnabled property set to True, if it is set to False after drawing and reading, the object will be displayed with a solid fill pattern set by the BackColor property. However, setting the CustomBrushEnabled property to True again will enable the custom fill to be displayed.
Even when CustomBrushEnabled property is set to False and drawing or loading is done, it is possible to change the brush to a custom brush by selectng the object and using the object's property dialog and related properties displayed by setting the DialogCustomBrushVisible property to True.
Note: If you want to mix custom brush and solid brush, please set CustomBrushEnabled property to True and set the solid brush with BrushKind property.
The specifications of the custom brush function are as follows.
- The objects that can use the custom brush are Rectangle, RoundRectangle, Ellipse, Text, Stamp, Polygon, and Pen (when ClosePenLine = True) objects for which the Fill property is valid.
- The fill pattern is determined by the brushes set in the BrushKind property and the other property settings required for each brush.
-
- For a solid brush, set the BrushKind property to a value of type System.Drawing.SolidBrush and set the BackColor property.
- For a hatch brush, set the BrushKind property to a value of type System.Drawing.Drawing2D.HatchBrush and set the HatchStyle, CustomBrushColor1, and CustomBrushColor2 properties.
- For a 2 color gradient brush, set the BrushKind property to a value of type System.Drawing.Drawing2D.LinearGradientBrush and set the CustomBrushColor1, CustomBrushColor2, and LinearGradientMode properties.
- For a texture brush, set the BrushKind property to a value of type
System.Drawing.TextureBrush and set the CustomBrushImageFileName
property.
Note: If each setting is not correct, it will not cause an error but there will be a solid fill using the System.Drawing.SolidBrush and BackColor property value.
- It is not possible to set individual elements of HatchBrush such as line thickness, spacing, angle and pattern. (Only the default pattern of the System.Drawing.Drawing2D.HatchStyle enumeration are possible). In addition, the position and angle of the hatch pattern are not changed even if you move, rotate or resize the object filled with the hatch pattern.
Setting Value Drawing example: Horizontal / Rotated BrushKind = KindOfBrush.HatchBrush
HatchStyle = HatchStyle.Cross
CustomBrushColor1 = Color.Red
CustomBrushColor2 = Color.TransparentWhen rotated, the hatch pattern angle does not change.
When the object size and position is changed,
the hatch pattern size and interval spacing doesn't change.
- The LinearGradientBrush is a two-color gradation display that matches the display range of each object, and the display changes according to the display scale of the ImageKit control and the size and position of the object. When an object is rotated, except for the Polygon and Pen objects whose gradation will not change, the direction of gradation is also rotated according to the rotation angle. This is bBecause Polygon and Pen objects are drawn by the coordinates of each point that constitutes them, and there is no angle of rotation. When Polygon and Pen objects are moved, rotated, or resized, the object will be filled with a solid color determined by the CustomBrushColor1 property.
Setting Value Drawing example: Horizontal / Rotated BrushKind = KindOfBrush.LinearGradientBrush
HatchStyle = HatchStyle.Cross
CustomBrushColor1 = Color.Red
CustomBrushColor2 = Color.Blue
LinearGradientMode = LinearGradientMode.HorizontalFor a rectangle object:
The gradation angle changes according to the object's angle of rotation
Changing the object's size and position
changes the gradation.
For a polygon object:
Object rotation does not change gradation
- The background image of TextureBrush is set using the CustomBrushImageFileName property. This background image is displayed in actual size (tiled) from the top left corner of the ImageKit control and therefore if the object is moved are resized, the background image of the TextureBrush does not change. When the object is rotated, the angle of the background image is not changed even if it is rotated as in the case of the Polygon and Pen objects, and the background image is also rotated according to the rotation angle in the case of other objects. (This is because Polygon and Pen objects are drawn by the coordinates of each point that constitutes them, and there is no "angle".)
Setting Value Drawing example: Horizontal / Rotated BrushKind = KindOfBrush.TextureBrush
CustomBrushImageFileName = "arrow1.png"
arrow1.pngFor a rectangle object:
The angle of the background image changes according to the angle of rotation of the object
When the object's size and position change
the size of the background image and its position does not change.
For a polygon object:
The angle of the background image does not change when the object is rotated.
Also See
ImageKit.Edit Members | Newtone.ImageKit.Win.ImageKit