Class Line
Used to create line objects.
Please see Example_08 and Example_35.
public class Line : IDrawable
- Inheritance
-
Line
- Implements
- Inherited Members
Constructors
Line()
The default constructor.
public Line()
Line(float, float, float, float)
Create a line object.
public Line(float x1, float y1, float x2, float y2)
Parameters
x1floatthe x coordinate of the start point.
y1floatthe y coordinate of the start point.
x2floatthe x coordinate of the end point.
y2floatthe y coordinate of the end point.
Methods
DrawOn(Page)
Draws this line on the specified page.
public float[] DrawOn(Page page)
Parameters
pagePagethe page to draw on.
Returns
- float[]
x and y coordinates of the bottom right corner of this component.
GetEndPoint()
Returns the end point of this line.
public Point GetEndPoint()
Returns
- Point
Point the point.
GetLineCapStyle()
Returns the line cap style.
public CapStyle GetLineCapStyle()
Returns
- CapStyle
the cap style.
GetStartPoint()
Returns the start point of this line.
public Point GetStartPoint()
Returns
- Point
Point the point.
ScaleBy(float)
Scales this line by the specified factor.
public Line ScaleBy(float factor)
Parameters
factorfloatthe factor used to scale the line.
Returns
- Line
this Line object.
SetActualText(string)
Sets the actual text for this line.
public Line SetActualText(string actualText)
Parameters
actualTextstringthe actual text for the line.
Returns
- Line
this Line.
SetAltDescription(string)
Sets the alternate description of this line.
public Line SetAltDescription(string altDescription)
Parameters
altDescriptionstringthe alternate description of the line.
Returns
- Line
this Line.
SetEndPoint(float, float)
Sets the x and y coordinates of the end point.
public Line SetEndPoint(float x, float y)
Parameters
Returns
- Line
this Line object.
SetLineCapStyle(CapStyle)
Sets the line cap style.
public Line SetLineCapStyle(CapStyle style)
Parameters
styleCapStylethe cap style of the current line. Supported values: CapStyle.BUTT, CapStyle.ROUND and CapStyle.PROJECTING_SQUARE
Returns
- Line
this Line object.
SetLocation(float, float)
Moves this line so that it starts at the specified point. The end point moves with it.
public Line SetLocation(float x, float y)
Parameters
Returns
- Line
this Line object.
SetStartPoint(float, float)
Sets the x and y coordinates of the start point.
public Line SetStartPoint(float x, float y)
Parameters
Returns
- Line
this Line object.
SetStrokeColor(int)
Sets the stroke color of this line. Color.transparent leaves it unchanged.
public Line SetStrokeColor(int color)
Parameters
colorintthe color specified as an integer.
Returns
- Line
this Line object.
SetStrokeColor(float[])
Sets the stroke color from an array of red, green and blue values.
public Line SetStrokeColor(float[] rgbColor)
Parameters
rgbColorfloat[]
Returns
SetStrokeDashPattern(string)
The line dash pattern controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash array and a dash phase. The elements of the dash array are positive numbers that specify the lengths of alternating dashes and gaps. The dash phase specifies the distance into the dash pattern at which to start the dash. The elements of both the dash array and the dash phase are expressed in user space units.
Examples of line dash patterns:
"[Array] Phase" Appearance Description
_______________ _________________ ____________________________________
"[] 0" ----------------- Solid line
"[3] 0" --- --- --- 3 units on, 3 units off, ...
"[2] 1" - -- -- -- -- 1 on, 2 off, 2 on, 2 off, ...
"[2 1] 0" -- -- -- -- -- -- 2 on, 1 off, 2 on, 1 off, ...
"[3 5] 6" --- --- 2 off, 3 on, 5 off, 3 on, 5 off, ...
"[2 3] 11" - -- -- -- 1 on, 3 off, 2 on, 3 off, 2 on, ...
public Line SetStrokeDashPattern(string pattern)
Parameters
patternstringthe line dash pattern.
Returns
- Line
this Line object.
SetStrokeWidth(float)
Sets the stroke width of this line.
public Line SetStrokeWidth(float width)
Parameters
widthfloatthe width.
Returns
- Line
this Line object.