Greetings,
Just discovered this forum, appears to be quite the resource indeed!!
I was wondering if anyone could shed some light on a problem i'm having.
I've set up a points array to capture mouse co-ordinates for use in drawing a curve to the canvas. It's working OK, except for the fact that the origin seems to be included in the array somehow, resulting in all the curves being anchored to the top left hand corner of the canvas. The rest of the curve is drawn correctly through the points that have been captured. Does anyone know what might be causing this problem?? Fragments of code attached below...
Thanks in advance,
- perps
Just discovered this forum, appears to be quite the resource indeed!!
I was wondering if anyone could shed some light on a problem i'm having.
I've set up a points array to capture mouse co-ordinates for use in drawing a curve to the canvas. It's working OK, except for the fact that the origin seems to be included in the array somehow, resulting in all the curves being anchored to the top left hand corner of the canvas. The rest of the curve is drawn correctly through the points that have been captured. Does anyone know what might be causing this problem?? Fragments of code attached below...
VB.NET:
Dim curvePoints(50) As Point
Dim curveCount As Integer = 0
If (e.Button = MouseButtons.Left) Then
curvePoints(curveCount).X = e.X
curvePoints(curveCount).Y = e.Y
curveCount = curveCount + 1
ElseIf (e.Button = MouseButtons.Right) Then
g.DrawCurve(linePen, curvePoints, tension)
curveCount = 0
End If
Thanks in advance,
- perps