Silverlight StrokeLineJoin in VB.NET

In this article you will learn about the StrokeLineJoin in Silverlight.
  • 1408

As you learn about the StrokeDashArray in my previous article, now we talk about the next property:

DashArray: "StrokeDashArray" is the property which we use to define our dashes.  This property indicates the pattern of dashes and spaces between the dashes.  The first value is the width of the dash and the second value is the space between the dashes. All you need is to define an array of double, size 2, and set the length of the dash as first element and the spacing between to dashes as second element of the array.

Both values are specific to the thickness of the line being drawn, so {1,1} will draw a dotted line (actually a dashed lines with square dashes).

And you want to draw more complex dashed lines, for example like the ones used in technical drawings, you can add to the array other couples of doubles, and draw dash-dot sequences: every even values is the length of dashes, odd values specifies gaps.

Now you see the next property which "used as like the StrokDeshArray and sometimes we use both of them together" the property is:

StrokeLineJoin: It specifies the shape to be used at the corners of paths or basic shapes when they are stroked. Certain line-joining situations and markers require that a path segment have directionality at its start and end points. Zero-length path segments have no directionality. In these cases, the following algorithm is used to establish directionality: to determine the directionality of the start point of a zero-length path segment, go backwards in the path data specification within the current subpath until you find a segment which has directionality at its end point (e.g., a path segment with non-zero length) and use its ending direction; otherwise, temporarily consider the start point to lack directionality.

Example of StrokeLineJoin 

<UserControl x:Class="SilverlightApplication21.MainPage"    
    <StackPanel Margin="20" Background="White">
    <Polyline Stroke="Blue" StrokeThickness="14" StrokeLineJoin="Bevel" 
="20,60,40,4,50,50,80,4,80,60" >

Output WIndow



Hope this article will help you to understand the working of  StrokeLineJoin in Silverlight.


More Articles

© 2020 DotNetHeaven. All rights reserved.