The image you are trying to draw the line on is 1 pixel wide by 1 pixel high. At most you will change a point and you need more than one point to draw a line.
@Kartoffelbrot, I was referring to line 1 in the code given above. The image being create (the one that is to be drawn on) is too small to draw a line on.