The V C++ GUI Framework:vBrush

From EDM2
Jump to: navigation, search

A class to specify the brush used to fill shapes.


[vquickr.htm#vBrush <v/vbrush.h>]
Class name:


Brushes are used to fill shapes. Brushes have two attributes, including color and style.


vBrush(unsigned int r = 0, unsigned int g = 0, unsigned int b = 0, int style = vSolid)

The brush constructor allows you to set the initial color and style of the brush. The default constructs a solid black brush.

int operator == , !=

You can use the operators == and != for comparisons.

vColor GetColor()

This method returns the current color of the brush as a vColor object.

int GetFillMode()

This method returns the fill mode of the brush (either vAlternate or vWinding).

int GetStyle()

This method returns the current style of the brush.

void SetColor(vColor& c)

You can use this method to set the brush color by passing in a vColor object.

int SetFillMode(int fillMode)

This method sets the fill mode of the brush. The fillMode parameter specifies one of two alternative filling algorithms, vAlternate or vWinding. These algorithms correspond to the equivalent algorithms on the native platforms.

void SetStyle(int style)

This method is used to set the style of the brush. Brush styles include:

The brush fills with a solid color.
The brush is transparent, which allows you to draw unfilled shapes.
The brush fills with a horizontal hatch pattern in the current color.
The brush fills with a vertical hatch pattern.
The brush fills with a left leaning diagonal hatch pattern.
The brush fills with a right leaning diagonal hatch pattern.
The brush fills with a vertical and horizontal cross hatch pattern.
The brush fills with a diagonal cross hatch pattern.