public void DrawPixel(UInt16 x, UInt16 y, Color888 color) { lock (this) { SetWindow(x, x, y, y); SendData((ushort)ColorConversion.ToRgb565(color)); } }
public static Color565 ToRgb565(this Color888 color) { UInt16 rgb = (UInt16)color; int bits = (((rgb >> 19) & 0x1f) << 11) | (((rgb >> 10) & 0x3f) << 6) | (((rgb >> 3) & 0x1f)); return((Color565)bits); }
public void DrawCircle(UInt16 x0, UInt16 y0, UInt16 radius, Color888 color) { for (int y = -radius; y <= radius; y++) { for (int x = -radius; x <= radius; x++) { if (x * x + y * y <= radius * radius) { DrawPixel((UInt16)(x + x0), (UInt16)(y + y0), color); } } } }