I fixed this and here is the code - another Q
Hi,
I add this routine to the graphics example. I unscrambled the way the code handles scaling and simplified it. This routine is called to plot a line from x1,y1 to x2, y2 and the line is scaled so it appears within the graph definition. By the way I don't know what but it appears that I had to add 4dpi to the y2 location - I think it compensates for stroke width , not sure.
The existing graph code is designed to plot multiple curves each with the same number of points via the curve array.
This code will allow you to lay lines anywhere on the graph.
I am plotting a curve and this showing two lines intersecting the curve.
Another Q - I wanted to plot an x or 0 or designation at the location in which the curves intersect. I tried using DrawPoint but it did not do anything. Any ideas?
Jerry
Sub PlotLine(x1location As Double, y1location As Double,x2location As Double, y2location As Double, i As Int)
Dim x1, y1, x2, y2 As Float
If x1location < ScaleXMin Then x1location=ScaleXMin
If x2location < ScaleXMin Then x2location=ScaleXMin
If x1location > ScaleXMax Then x1location=ScaleXMax
If x2location > ScaleXMax Then x2location=ScaleXMax
If y1location < ScaleYMin Then y1location=ScaleYMin
If y2location < ScaleYMin Then y2location=ScaleYMin
If y1location > ScaleYMax Then y1location=ScaleYMax
If y2location > ScaleYMax Then y2location=ScaleYMax
x1= GridX0+(Abs(ScaleXMin)+ x1location)*GridDeltaX
y1 = GridY0 + (ScaleYMax - y1location) * ScaleY
x2= GridX0+(Abs(ScaleXMin)+ x2location)*GridDeltaX
y2 = GridY0 + (ScaleYMax - y2location) * ScaleY + 4dip
cvsGraph.DrawLine(x1, y1, x2, y2, CurveLineColor(i), CurveLineStroke(i))
' ???????? cvsGraph.DrawPoint(x2, y2, Colors.black)
End Sub