public static void drawLine(int startX , int startY , int endX , int endY , byte data[]) {
		int pos;
		double xLength = endX - startX;
		double yLength = endY - startY;
		
		double step = (yLength != 0 ? xLength/yLength : xLength);
		step = ((int)step == 0 ? 1 : (int)step);
		
		double slope = (xLength != 0 ? yLength/xLength : Math.tan(Math.toRadians(-90)));
		slope = (slope < 0 ? -1 : 1);
	
		for (int x=startX ; x<endX ; x++) {
			if ( x % (int)step == 0) {
				startY+= slope;
			}
			pos=(240 - startY)*960 + (x*3);
			if ((pos >=0)&&( pos + 2 < data.length)) {
				data[pos] = ccBlue;
				pos++;
				data[pos] = ccGreen;
				pos++;
				data[pos] = ccRed;
			} else {
				break;
			}
		}
	}