LinePattern Class Reference

Provides means for defining custom pattern from lines and point symbols for rendering polyline layers. More...

Collaboration diagram for LinePattern:
Collaboration graph

Public Member Functions

void AddLine (uint Color, float Width, tkDashStyle style)
 Adds a line segment to the pattern. More...
 
LineSegment AddMarker (tkDefaultPointSymbol Marker)
 Adds a segment represented by point symbol (marker). More...
 
void Clear ()
 Removes all the line segments from the pattern. More...
 
void Deserialize (string newVal)
 Restores the state of the line segment from the string. More...
 
bool Draw (IntPtr hdc, float x, float y, int clipWidth, int clipHeight, uint BackColor, byte backAlpha)
 Draws a line pattern on the specified device context. More...
 
bool DrawVB (int hdc, float x, float y, int clipWidth, int clipHeight, uint BackColor, byte backAlpha)
 Draws a line pattern on the specified device context. More...
 
string get_ErrorMsg (int ErrorCode)
 Gets the text description of the specified error code. More...
 
LineSegment get_Line (int Index)
 Gets the reference to the line segment stored at the specified position in the pattern. More...
 
bool InsertLine (int Index, uint Color, float Width, tkDashStyle style)
 Inserts line definition at the specified position of the pattern. More...
 
LineSegment InsertMarker (int Index, tkDefaultPointSymbol Marker)
 Insert marker definition on the pattern at the specified position. More...
 
bool RemoveItem (int Index)
 Removes a segment stored at the specified position of the pattern. More...
 
string Serialize ()
 Saves the state of the object to the string. More...
 
void set_Line (int Index, LineSegment retval)
 Changes line segment at the specified position to the new one. More...
 

Properties

int Count [get]
 Returns the number of all segments in the pattern. More...
 
ICallback GlobalCallback [get, set]
 Gets or sets the global callback object which is used for passing to the client the information about the progress of time consuming tasks and errors. More...
 
string Key [get, set]
 Gets or sets a string value associated with the instance of the class. It can store any information provided developer. More...
 
int LastErrorCode [get]
 Retrieves the numeric code of the last error that took place in the class. More...
 
byte Transparency [get, set]
 Gets or sets the transparency of the line pattern. The value ranges from 0(opaque) to 255(transparent). More...
 

Detailed Description

Provides means for defining custom pattern from lines and point symbols for rendering polyline layers.

The line pattern consists of line segments which can be representing by lines of various style, width and color or by markers. Line segments are drawn one atop of the other in the sequence defined in the line pattern.



Here is a diagram for the LinePattern class.

dot_inline_dotgraph_49.png

Graph description

New API 4.8:
Added in version 4.8
Examples
IntersectionLength.cs, LinePattern.cs, and Tracking.cs.

Member Function Documentation

◆ AddLine()

void LinePattern.AddLine ( uint  Color,
float  Width,
tkDashStyle  style 
)

Adds a line segment to the pattern.

Parameters
ColorThe color of the line.
WidthThe width of the line.
styleThe style of the line.
Examples
IntersectionLength.cs, LinePattern.cs, and Tracking.cs.

◆ AddMarker()

LineSegment LinePattern.AddMarker ( tkDefaultPointSymbol  Marker)

Adds a segment represented by point symbol (marker).

Parameters
MarkerThe type of the marker.
Returns
Reference to the newly added segment or NULL reference on failure.
Examples
LinePattern.cs.

◆ Clear()

void LinePattern.Clear ( )

Removes all the line segments from the pattern.

◆ Deserialize()

void LinePattern.Deserialize ( string  newVal)

Restores the state of the line segment from the string.

Parameters
newValA string generated by LinePattern.Serialize() method.

◆ Draw()

bool LinePattern.Draw ( IntPtr  hdc,
float  x,
float  y,
int  clipWidth,
int  clipHeight,
uint  BackColor,
byte  backAlpha 
)

Draws a line pattern on the specified device context.

The method can be used to draw map legend.

Parameters
hdcThe handle of the device context.
xThe x coordinate of the upper left corner of the drawing.
yThe y coordinate of the upper left corner of the drawing.
clipWidthThe width of the clipping rectangle.
clipHeightThe height of the clipping rectangle.
BackColorThe back color of the device context the drawing is performed at. The value should be specified to ensure correct blending when semi-transparent colors are used.
backAlphaThe alpha component of the back color of the device context the drawing is performed at. Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
Returns
True on successful drawing and false on failure.

◆ DrawVB()

bool LinePattern.DrawVB ( int  hdc,
float  x,
float  y,
int  clipWidth,
int  clipHeight,
uint  BackColor,
byte  backAlpha 
)

Draws a line pattern on the specified device context.

The method can be used to draw map legend.

Parameters
hdcThe handle of the device context.
xThe x coordinate of the upper left corner of the drawing.
yThe y coordinate of the upper left corner of the drawing.
clipWidthThe width of the clipping rectangle.
clipHeightThe height of the clipping rectangle.
BackColorThe back color of the device context the drawing is performed at. The value should be specified to ensure correct blending when semi-transparent colors are used.
backAlphaThe alpha component of the back color of the device context the drawing is performed at. Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
Returns
True on successful drawing and false on failure.

◆ get_ErrorMsg()

string LinePattern.get_ErrorMsg ( int  ErrorCode)

Gets the text description of the specified error code.

Parameters
ErrorCodeThe numeric error code retrieved by ShapeDrawingOptions.LastErrorCode property.
Returns
The description of the error.

◆ get_Line()

LineSegment LinePattern.get_Line ( int  Index)

Gets the reference to the line segment stored at the specified position in the pattern.

Parameters
IndexThe index of the segment.
Returns
The reference to the line segment or NULL reference on failure.

◆ InsertLine()

bool LinePattern.InsertLine ( int  Index,
uint  Color,
float  Width,
tkDashStyle  style 
)

Inserts line definition at the specified position of the pattern.

Parameters
IndexThe index to insert the new line segment at.
ColorThe color of the line.
WidthThe width of the line.
styleThe style of the line.
Returns
True on success and false otherwise.

◆ InsertMarker()

LineSegment LinePattern.InsertMarker ( int  Index,
tkDefaultPointSymbol  Marker 
)

Insert marker definition on the pattern at the specified position.

Parameters
IndexThe index to insert the new segment at.
MarkerThe type of marker.
Returns
True on success and false otherwise.

◆ RemoveItem()

bool LinePattern.RemoveItem ( int  Index)

Removes a segment stored at the specified position of the pattern.

Parameters
IndexThe position to remove the segment at.
Returns
True on success and false otherwise.

◆ Serialize()

string LinePattern.Serialize ( )

Saves the state of the object to the string.

Returns
A string with serialized state.

◆ set_Line()

void LinePattern.set_Line ( int  Index,
LineSegment  retval 
)

Changes line segment at the specified position to the new one.

Parameters
IndexThe index of segment.
retvalThe reference to the new segment.

Property Documentation

◆ Count

int LinePattern.Count
get

Returns the number of all segments in the pattern.

◆ GlobalCallback

ICallback LinePattern.GlobalCallback
getset

Gets or sets the global callback object which is used for passing to the client the information about the progress of time consuming tasks and errors.

An instance of the class which implements ICallback interface should be passed. The class should be implemented by caller.

Deprecated:
v4.9.3 Use GlobalSettings.ApplicationCallback instead.

◆ Key

string LinePattern.Key
getset

Gets or sets a string value associated with the instance of the class. It can store any information provided developer.

◆ LastErrorCode

int LinePattern.LastErrorCode
get

Retrieves the numeric code of the last error that took place in the class.

The usage of this property clears the error code.

◆ Transparency

byte LinePattern.Transparency
getset

Gets or sets the transparency of the line pattern. The value ranges from 0(opaque) to 255(transparent).

The default value is 255. The setting affects the drawing of both lines and markers.