From: Dahai on
You might also think of using
[x y] = intline(x1, x2, y1, y2)
to get the line point coordinates for background manipulation.