Jump to content

VBrush: Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
 
Line 2: Line 2:


==Synopsis==
==Synopsis==
; '''Header:'''
;Header: <tt>[vquickr.htm#vBrush <v/vbrush.h>]</tt>
: <tt>[vquickr.htm#vBrush <v/vbrush.h>]</tt>
;Class name: vBrush
; '''Class name:'''
: vBrush


==Description==
==Description==
Line 11: Line 9:


==Methods==
==Methods==
====vBrush(unsigned int r = 0, unsigned int g = 0, unsigned int b = 0, int style = vSolid)====
;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.
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 <tt><nowiki>==</nowiki></tt> and <tt><nowiki>!=</nowiki></tt> for comparisons.
====int operator == , !=====
;vColor GetColor():This method returns the current color of the brush as a <tt>vColor</tt> object.
You can use the operators <tt><nowiki>==</nowiki></tt> and <tt><nowiki>!=</nowiki></tt> for comparisons.
;int GetFillMode():This method returns the fill mode of the brush (either <tt>vAlternate</tt> or <tt>vWinding</tt>).
 
;int GetStyle():This method returns the current style of the brush.
====vColor GetColor()====
;void SetColor(vColor& c):You can use this method to set the brush color by passing in a <tt>vColor</tt> object.
This method returns the current color of the brush as a <tt>vColor</tt> object.
;int SetFillMode(int fillMode):This method sets the fill mode of the brush. The fillMode parameter specifies one of two alternative filling algorithms, <tt>vAlternate</tt> or <tt>vWinding</tt>. 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:
====int GetFillMode()====
:;vSolid: The brush fills with a solid color.
This method returns the fill mode of the brush (either <tt>vAlternate</tt> or <tt>vWinding</tt>).
:;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.
====int GetStyle()====
:;vVerticleHatch: The brush fills with a vertical hatch pattern.
This method returns the current style of the brush.
:;vLeftDiagonalHatch: The brush fills with a left leaning diagonal hatch pattern.
 
:;vRightDiagonalHatch: The brush fills with a right leaning diagonal hatch pattern.
====void SetColor(vColor& c)====
:;vCrossHatch: The brush fills with a vertical and horizontal cross hatch pattern.
You can use this method to set the brush color by passing in a <tt>vColor</tt> object.
:;vDiagonalCrossHatch: The brush fills with a diagonal cross hatch pattern.
 
====int SetFillMode(int fillMode)====
This method sets the fill mode of the brush. The fillMode parameter specifies one of two alternative filling algorithms, <tt>vAlternate</tt> or <tt>vWinding</tt>. 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.


[[Category:V C++ GUI Framework]]
[[Category:V C++ GUI Framework]]

Latest revision as of 22:02, 9 April 2020

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.