Jump to content

VPen: Difference between revisions

From EDM2
Created page with "A class to specify the pen used to draw lines and shapes. ==Synopsis== ; '''Header:''' : <tt>[vquickr.htm#vPen <v/vpen.h>]</tt> ; '''Class name:''' : vPen ==Description== Pen..."
 
Ak120 (talk | contribs)
mNo edit summary
Line 2: Line 2:


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


==Description==
==Description==
Pens are used to draw lines and the outlines of shapes. Pens have several attributes, including color, width, and style.
Pens are used to draw lines and the outlines of shapes. Pens have several attributes, including color, width, and style.


Line 54: Line 52:


====void SetWidth(int width)====
====void SetWidth(int width)====
This sets the width of the line the pen will draw.
This sets the width of the line the pen will draw.


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

Revision as of 18:33, 1 March 2017

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.