Difference between revisions of "Graphics.LineDash"

From Xojo Documentation

(Notes)
 
Line 23: Line 23:
 
Setting LineDash to Nil restores drawing to solid lines.
 
Setting LineDash to Nil restores drawing to solid lines.
  
LineDash affects [[Graphics.DrawLine|DrawLine]], [[Graphics.DrawOval|DrawOval]], Graphics.DrawPath|DrawPath]], [[Graphics.DrawPolygon|DrawPolygon]], [[Graphics.DrawRectangle|DrawRectangle]], and [[Graphics.DrawRoundRectangle|DrawRoundRectangle]].  
+
LineDash affects [[Graphics.DrawLine|DrawLine]], [[Graphics.DrawOval|DrawOval]], [[Graphics.DrawPath|DrawPath]], [[Graphics.DrawPolygon|DrawPolygon]], [[Graphics.DrawRectangle|DrawRectangle]], and [[Graphics.DrawRoundRectangle|DrawRoundRectangle]].  
  
 
[[Graphics.LineCap|LineCap]] and [[Graphics.LineJoin|LineJoin]] will affect how the dashes are drawn.
 
[[Graphics.LineCap|LineCap]] and [[Graphics.LineJoin|LineJoin]] will affect how the dashes are drawn.

Latest revision as of 17:02, 13 November 2020

Method

Graphics.LineDash() As Double

New in 2020r2

Supported for all project types and targets.


Method

Graphics.LineDash(Assigns dashes() As Double)

New in 2020r2

Supported for all project types and targets.


Specifies the on/off dash pattern.

Notes

Passing an array with the values 1.0, 2.0 means a dash of 1 unit with a spacing of 2 units per dash.

Setting LineDash to Nil restores drawing to solid lines.

LineDash affects DrawLine, DrawOval, DrawPath, DrawPolygon, DrawRectangle, and DrawRoundRectangle.

LineCap and LineJoin will affect how the dashes are drawn.

Sample Code

Draw a diagonal line with 2 unit dashes and 3 unit gaps

g.PenSize = 5
g.LineDash = Array(2.0, 3.0)
g.DrawLine(0, 0, g.Width, g.Height)

See Also

Graphics.LineDashOffset property.