/// <summary> /// Draw a single pixel using the pen color /// </summary> /// <param name="x">x location </param> /// <param name="y">y location</param> public void DrawPixel(int x, int y) { if (IsPixelInBounds(x, y) == false) { return; } _display.DrawPixel(GetXForRotation(x, y), GetYForRotation(x, y)); }
/// <summary> /// Draw a single pixel using the pen color /// </summary> /// <param name="x">x location </param> /// <param name="y">y location</param> public void DrawPixel(int x, int y) { _display.DrawPixel(GetXForRotation(x, y), GetYForRotation(x, y)); }
public void DrawLine(int x0, int y0, int x1, int y1, Color color) { var steep = Math.Abs(y1 - y0) > Math.Abs(x1 - x0); if (steep) { int t; t = x0; // swap x0 and y0 x0 = y0; y0 = t; t = x1; // swap x1 and y1 x1 = y1; y1 = t; } if (x0 > x1) { int t; t = x0; // swap x0 and x1 x0 = x1; x1 = t; t = y0; // swap y0 and y1 y0 = y1; y1 = t; } var dx = x1 - x0; var dy = Math.Abs(y1 - y0); var error = dx / 2; var ystep = y0 < y1 ? 1 : -1; var y = y0; for (var x = x0; x <= x1; x++) { _display.DrawPixel(steep ? y : x, steep ? x : y, color); error = error - dy; if (error < 0) { y += ystep; error += dx; } } }
/// <summary> /// Draw a single pixel /// </summary> /// <param name="x">x location </param> /// <param name="y">y location</param> /// <param name="colored">Turn the pixel on (true) or off (false).</param> public void DrawPixel(int x, int y, bool colored = true) { _display.DrawPixel(x, y, colored); }
/// <summary> /// Draw a single pixel /// </summary> /// <param name="x">x location </param> /// <param name="y">y location</param> /// <param name="colored">Turn the pixel on (true) or off (false).</param> public void DrawPixel(int x, int y, bool colored = true) { _display.DrawPixel(GetXForRotation(x, y), GetYForRotation(x, y), colored); }