I think your best bet is some math and the update(x, y) method from Point.
You have the two points that make the line, from the Polyline Object. You know that
y=mx+b, and m = (y2-y1)/(x2-x1)
so you can find the equation for the line. Then you can produce x values, and find the associated y values, and then use the update method to set the point.
Low level graphics manipulation is a bit involved. Good luck man