SvgImageItemAppearance.BorderThickness Property
Gets or sets the custom border’s thickness, in pixels. When the image is scaled based on the SvgImageBox.SizeMode setting, the custom borders are scaled as well.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.Utils.v24.1.dll
NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core
Declaration
Property Value
Type | Description |
---|---|
Single | The border’s thickness, in pixels. If the value is zero or negative, no custom border is painted. |
Remarks
To paint custom borders for image items:
- Set the BorderColor property.
- Set the BorderThickness property to a positive floating point number. Initially, this property value is -1, and thus no custom border is painted.
Example
The following example applies custom borders for all image items (via the SvgImageBox.ItemAppearance property) and overrides these settings for a specific item (via the SvgImageItem.Appearance property).
// The default appearance settings for all items.
svgImageBox1.ItemAppearance.Normal.BorderColor = Color.Black;
svgImageBox1.ItemAppearance.Normal.BorderThickness = 1;
// The appearance settings for a specific item.
var orangeSlice = svgImageBox1.FindItemByTag("orange");
if (orangeSlice != null) {
orangeSlice.Appearance.Normal.BorderColor = Color.Green;
}
Zoom Images
If you zoom an SVG image (see SvgImageBox.SizeMode) the custom borders are zoomed as well.
The following SVG image has the original size of 32x32 pixels.
If you apply a 1-pixel thick black border, the image is painted as follows in Clip and Zoom size mode, respectively.
Note
The SvgImageBox control does not allocate extra space to draw custom borders. The borders may be trimmed if there is not enough space at the edges.
Ensure that the original SVG image has enough space to draw custom borders for image items.