Back to Devexpress

AppearanceObject.GetBackBrush(GraphicsCache, Rectangle) Method

windowsforms-devexpress-dot-utils-dot-appearanceobject-dot-getbackbrush-x28-devexpress-dot-utils-dot-drawing-dot-graphicscache-system-dot-drawing-dot-rectangle-x29.md

latest3.2 KB
Original Source

AppearanceObject.GetBackBrush(GraphicsCache, Rectangle) Method

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

Namespace : DevExpress.Utils

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
public Brush GetBackBrush(
    GraphicsCache cache,
    Rectangle rect
)
vb
Public Function GetBackBrush(
    cache As GraphicsCache,
    rect As Rectangle
) As Brush

Parameters

NameTypeDescription
cacheGraphicsCache

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

TypeDescription
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

GetBackColor

GetBackColor2()

AppearanceObject Class

AppearanceObject Members

DevExpress.Utils Namespace