CurrentBrush() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns the Brush (fill) style currently in use. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

CurrentBrush()

Return Value

Brush

Description

The CurrentBrush() function returns the current Brush style. This corresponds to the fill style displayed in the Region Style dialog box. MapInfo Pro assigns the current Brush value to any filled objects (ellipses, rectangles, rounded rectangles, or regions) drawn by the user. If a MapBasic program creates a filled object through a statement such as the Create Region statement, but the statement does not include a Brush clause, the object will be assigned the current Brush value.

The return value of the CurrentBrush() function can be assigned to a Brush variable, or may be used as a parameter within a statement that takes a Brush setting as a parameter (such as Set Map statement or Shade statement).

To extract specific Brush attributes (such as the color), call the StyleAttr() function.

For more information about Brush settings, see Brush clause.

Example

Dim b_current_fill As Brush
b_current_fill = CurrentBrush()

See Also:

Brush clause, MakeBrush() function, Set Style statement, StyleAttr() function