How to use Canvas.DrawLine

Hi Choppa,

Use these Canvas tools

especially the DrawShape . Use the advice in the documentation Canvas to place your shape on the Canvas.

DrawShape will draw your triangle and square or rhombus etc. when you provide a list of screen coordinate x,y pairs of the points required to draw the shape. This explanation of how the x,y coordinates are arranged in a Canvas may help.

DrawArc( left , top , right , bottom , startAngle , sweepAngle , useCenter , fill )

Draw an arc on Canvas, by drawing an arc from a specified oval (specified by left, top, right & bottom). Start angle is 0 when heading to the right, and increase when rotate clockwise. When useCenter is true, a sector will be drawed instead of an arc. When fill is true, a filled arc (or sector) will be drawed instead of just an outline.

DrawCircle( centerX , centerY , radius , fill )

Draws a circle (filled in) with the given radius centered at the given coordinates on the Canvas.

DrawLine( x1 , y1 , x2 , y2 )

Draws a line between the given coordinates on the canvas.

DrawPoint( x , y )

Draws a point at the given coordinates on the canvas.

DrawShape( pointList , fill )

Draws a shape on the canvas. pointList should be a list contains sub-lists with two number which represents a coordinate. The first point and last point does not need to be the same. e.g. ((x1 y1) (x2 y2) (x3 y3)) When fill is true, the shape will be filled.

DrawText( text , x , y )

Draws the specified text relative to the specified coordinates using the values of the FontSize and TextAlignment properties.

Why not experiment and show us what you discover?

Regards,
Steve