VPen: Difference between revisions
Appearance
m Ak120 moved page The V C++ GUI Framework:vPen to VPen |
mNo edit summary |
||
Line 2: | Line 2: | ||
==Synopsis== | ==Synopsis== | ||
; | ;Header: <tt><v/vpen.h></tt> | ||
: <tt><v/vpen.h></tt> | ;Class name: vPen | ||
; | |||
: vPen | |||
==Description== | ==Description== | ||
Line 11: | Line 9: | ||
==Methods== | ==Methods== | ||
;vPen(unsigned int r = 0, unsigned int g = 0, unsigned int b = 0, int width = 1, int style = vSolid):The constructor for a pen allows you to specify the pen's color, width, and style. The default will construct a solid black pen of width 1. | |||
;int operator ==, !:You can use the operators <tt><nowiki>==</nowiki></tt> and <tt><nowiki>!=</nowiki></tt> for comparisons. | |||
;vColor GetColor():This method returns the current color of the pen as a <tt>vColor</tt> object. | |||
The constructor for a pen allows you to specify the pen's color, width, and style. The default will construct a solid black pen of width 1. | ;int GetStyle():This method returns the current style of the pen. | ||
;void GetWidth():This gets the width of the line the pen will draw. | |||
;void SetColor(vColor& c):You can use this method to set the pen color by passing in a <tt>vColor</tt> object. | |||
;void SetStyle(int style):This method is used to change the style of a pen. Styles include: | |||
You can use the operators <tt><nowiki>==</nowiki></tt> and <tt><nowiki>!=</nowiki></tt> for comparisons. | :;vSolid: The pen draws a solid line. | ||
:;vTransparent: The pen is transparent. A transparent pen can be used to avoid drawing borders around shapes. When drawing text, a transparent pen draws the text over the existing background. | |||
:;vDash: The pen draws a dashed line. | |||
:;vDot: The pen draws a dotted line. | |||
This method returns the current color of the pen as a <tt>vColor</tt> object. | :;vDashDot: The pen draws an alternating dash and dotted line. | ||
;void SetWidth(int width):This sets the width of the line the pen will draw. | |||
This method returns the current style of the pen. | |||
This gets the width of the line the pen will draw. | |||
You can use this method to set the pen color by passing in a <tt>vColor</tt> object. | |||
This method is used to change the style of a pen. Styles include: | |||
; | |||
: The pen draws a solid line. | |||
; | |||
: The pen is transparent. A transparent pen can be used to avoid drawing borders around shapes. When drawing text, a transparent pen draws the text over the existing background. | |||
; | |||
: The pen draws a dashed line. | |||
; | |||
: The pen draws a dotted line. | |||
; | |||
: The pen draws an alternating dash and dotted line. | |||
This sets the width of the line the pen will draw. | |||
[[Category:V C++ GUI Framework]] | [[Category:V C++ GUI Framework]] |
Latest revision as of 22:32, 9 April 2020
A class to specify the pen used to draw lines and shapes.
Synopsis
- Header
- <v/vpen.h>
- Class name
- vPen
Description
Pens are used to draw lines and the outlines of shapes. Pens have several attributes, including color, width, and style.
Methods
- vPen(unsigned int r = 0, unsigned int g = 0, unsigned int b = 0, int width = 1, int style = vSolid)
- The constructor for a pen allows you to specify the pen's color, width, and style. The default will construct a solid black pen of width 1.
- int operator ==, !
- You can use the operators == and != for comparisons.
- vColor GetColor()
- This method returns the current color of the pen as a vColor object.
- int GetStyle()
- This method returns the current style of the pen.
- void GetWidth()
- This gets the width of the line the pen will draw.
- void SetColor(vColor& c)
- You can use this method to set the pen color by passing in a vColor object.
- void SetStyle(int style)
- This method is used to change the style of a pen. Styles include:
- vSolid
- The pen draws a solid line.
- vTransparent
- The pen is transparent. A transparent pen can be used to avoid drawing borders around shapes. When drawing text, a transparent pen draws the text over the existing background.
- vDash
- The pen draws a dashed line.
- vDot
- The pen draws a dotted line.
- vDashDot
- The pen draws an alternating dash and dotted line.
- void SetWidth(int width)
- This sets the width of the line the pen will draw.