public void Line_DDA(int x0, int y0, int x1, int y1, int color) { if (this.LineWidth != 1) { this.LineWidth_AA_Bresenham(x0, y0, x1, y1, ColorTool.IntToColor(color)); return; } int dx = x1 - x0, dy = y1 - y0; int step = Math.Abs(dx) > Math.Abs(dy) ? Math.Abs(dx) : Math.Abs(dy); //if (Math.Abs(dx) > Math.Abs(dy)) step = Math.Abs(dx); else step = Math.Abs(dy); float x = x0, y = y0, incX = dx / (float)step, incY = dy / (float)step; for (int i = 0; i <= step; i++) { this.TrySetPixel((int)Math.Round(x), (int)Math.Round(y), color); x += incX; y += incY; } }