The V C++ GUI Framework:vBrush

From EDM2
Jump to: navigation, search

A class to specify the brush used to fill shapes.

Synopsis

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

Description

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

Methods

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:

vSolid
The brush fills with a solid color.
vTransparent
The brush is transparent, which allows you to draw unfilled shapes.
vHorizontalHatch
The brush fills with a horizontal hatch pattern in the current color.
vVerticleHatch
The brush fills with a vertical hatch pattern.
vLeftDiagonalHatch
The brush fills with a left leaning diagonal hatch pattern.
vRightDiagonalHatch
The brush fills with a right leaning diagonal hatch pattern.
vCrossHatch
The brush fills with a vertical and horizontal cross hatch pattern.
vDiagonalCrossHatch
The brush fills with a diagonal cross hatch pattern.