Class WPen

java.lang.Object

public class WPen
extends WJavaScriptExposableObject
A value class that defines the style for pen strokes.

A pen defines the properties of how lines (that may surround shapes) are rendered.

A pen with width 0 is a cosmetic pen, and is always rendered as 1 pixel width, regardless of transformations. Otherwized, the pen width is modified by the transformation set on the painter.

JavaScript exposability

A WPen is JavaScript exposable. If a WPen is JavaScript bound, it can be accessed in your custom JavaScript code through its handle's jsRef(). At the moment, only the getColor() property is exposed, e.g. a pen with the color WColor(10,20,30,255) will be represented in JavaScript as:


 {
 color: [10,20,30,255]
 }

 

Warning: A WPen that is JavaScript exposed should be modified only through its handle. Any attempt at modifying it will cause an exception to be thrown.

See Also:
WPainter.setPen(WPen p), WBrush, WPaintedWidget.createJSPen()