Coordinate from a vector

Hi, I need to draw a straight line from x,y to x1,y1 and put the coordinate (every 32 pixel) into a vector.Example (0,0) (0,96)vector: { 0 0, 0 32, 0 64, 0 96}How I can do this?
[198 byte] By [Mesinaa] at [2007-10-3 4:51:09]
# 1
Have a look at the [url= http://en.wikipedia.org/wiki/Bresenham's_line_algorithm]Bresenham[/url] algorithm.kind regards,Jos
JosAHa at 2007-7-14 22:55:49 > top of Java-index,Java Essentials,Java Programming...
# 2

To implement the lines codes:

if steep then

swap(x0, y0)

swap(x1, y1)

if x0 > x1 then

swap(x0, x1)

swap(y0, y1)

from Bresenham Algorithms... it's correct to use a java swap method like this:

public void swap(int var1, int var2)

{

int temp = var1;

var1 = var2;

var2 = temp;

}

Mesinaa at 2007-7-14 22:55:49 > top of Java-index,Java Essentials,Java Programming...