- 3 minutes to read
Ornamental elements are optional elements used to decorate a gauge. This group includes spindle caps, background layers and effect layers.
A spindle cap is represented by the ArcScaleSpindleCap class. Like many other gauge elements, spindle caps have multiple pre-defined shapes. To select the required shape, use the ArcScaleSpindleCap.ShapeType property.
Background layers are images of the certain shape and style that are used as the underlying layer for all base gauge elements. Each background layer has the BaseLeafPrimitive.ZOrder property set to 1000, which arranges it behind all the other elements. If you want to bring this layer in front of other gauge elements (or paint it above other layers, if there are any), you need to set the ZOrder property to a lower value.
For example, the following picture illustrates a circular gauge’s background layer that is overlapped by the scale, whose ZOrder is set to 0 by default.
To move a background layer within a circular gauge, use the ArcScaleBackgroundLayer.ScaleCenterPos property. The size of each background layer can be set explicitly by using the ArcScaleBackgroundLayer.Size property.
Background layers for linear gauges do not have the Size property. Instead, you need to set the LinearScaleBackgroundLayer.ScaleStartPos and LinearScaleBackgroundLayer.ScaleEndPos properties to shift, rotate or zoom the layer relative to its corresponding LinearScaleBackgroundLayer.LinearScale.
Effect layers add a style effect (e.g., a glare effect) to your gauge. Opposite to background layers, effect layers are by default arranged above all the rest of the gauge elements, having the BaseLeafPrimitive.ZOrder property set to -1000. The figure below illustrates an example.
Effect layers are arranged and customized identically to background layers (ScaleCenterPos and Size property for circular gauges, ScaleStartPos and ScaleEndPos for linear gauges).