Table of Contents

Class PenProp

Namespace
Root.ReportNet.Pdf
Assembly
ReportNet.dll

Defines the properties of a pen, where the dimensions are in points.

public class PenProp
Inheritance
PenProp
Derived
Inherited Members

Examples

PenProp redPen = new PenProp(1, Color.Red);
PenProp redDashedPen = new PenProp(1, Color.Red, 2, 0.5);

Constructors

PenProp(double, Color, params double[])

Initializes a new instance of the PenProp class with the specified width, color and pattern (on/off).

public PenProp(double width, Color color, params double[] patternOnOff)

Parameters

width double

The width of the pen in points. The width zero means hairline.

color Color

The color of the pen.

patternOnOff double[]

The pattern values for the pen (on/off) in points.

Remarks

On-Off-Pattern:

Parameter patternOnOffDescriptionExample
- (no parameter)line without dashesnew PenProp(0.5, Color.Blue)
one numberx units on, x units offnew PenProp(0.5, Color.Blue, 2)
list of numbers: a, b, c, d, ...a units on, b units off, c units on, d units off, ...new PenProp(0.5, Color.Blue, 5, 1, 2, 1)

PenProp(double, params double[])

Initializes a new instance of the PenProp class with the specified width and pattern (on/off).

public PenProp(double width, params double[] patternOnOff)

Parameters

width double

The width of the pen in points. The width zero means hairline.

patternOnOff double[]

The pattern values for the pen (on/off) in points.

Remarks

On-Off-Pattern:

Parameter patternOnOffDescriptionExample
- (no parameter)line without dashesnew PenProp(0.5, Color.Blue)
one numberx units on, x units offnew PenProp(0.5, Color.Blue, 2)
list of numbers: a, b, c, d, ...a units on, b units off, c units on, d units off, ...new PenProp(0.5, Color.Blue, 5, 1, 2, 1)

Properties

Color

Gets the color of the pen.

public Color Color { get; }

Property Value

Color

The color of the pen.

PatternOnOff

Gets the pattern values of the pen.

public double[] PatternOnOff { get; }

Property Value

double[]

The array of pattern values.

Remarks

On-Off-Pattern:

Property PatternOnOffDescriptionExample
- (empty array)line without dashes[]
one numberx units on, x units off[2]
list of numbers: a, b, c, d, ...a units on, b units off, c units on, d units off, ...[5, 1, 2, 1]

Width

Gets the width of the pen. The width zero means hairline.

public double Width { get; }

Property Value

double

The width in points.

WidthMM

Gets the width of the pen in millimeters. The width zero means hairline.

public double WidthMM { get; }

Property Value

double

The width in millimeters.

Methods

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Operators

operator ==(PenProp?, PenProp?)

Determines whether two pens are equal.

public static bool operator ==(PenProp? left, PenProp? right)

Parameters

left PenProp

The first pen to compare.

right PenProp

The second pen to compare.

Returns

bool

true if the two pens are equal; otherwise false.

operator !=(PenProp?, PenProp?)

Determines whether two pens are not equal.

public static bool operator !=(PenProp? left, PenProp? right)

Parameters

left PenProp

The first pen to compare.

right PenProp

The second pen to compare.

Returns

bool

true if the two pens are not equal; otherwise false.