Skip to main content
A newer version of this page is available. .

AppearanceObject.GetBackBrush(GraphicsCache, Rectangle) Method

Gets the brush used to draw an element’s background.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v19.2.dll

Declaration

public Brush GetBackBrush(
    GraphicsCache cache,
    Rectangle rect
)

Parameters

Name Type Description
cache GraphicsCache

A GraphicsCache object that provides access to the pens and brushes used for painting.

rect Rectangle

A Rectangle structure specifying the rectangle for which a brush is created.

Returns

Type Description
Brush

A Brush descendant representing the brush specified by the appearance object’s settings.

Remarks

If the end color of the gradient’s background brush is Color.Empty or is equal to the starting color, the GetBackBrush method returns a solid brush whose color is specified by the background color settings of the current appearance object. Otherwise, this method returns a linear gradient brush.

If the cache parameter’s value is not a null reference, the GetBackBrush method uses the GraphicsCache object to obtain the brush. This allows you to obtain the brush more quickly, since it may already be stored within the cache. Otherwise, a new Brush descendant with appropriate settings is created and returned.

Use the AppearanceObject.GetBackColor and AppearanceObject.GetBackColor2 methods to obtain the starting and ending background colors specified by the appearance object’s settings.

See Also