public static void DrawArea(this IT8951SPIDevice device, Action <DrawingBuffer> pixelOperateCallback, ushort x, ushort y, ushort width, ushort height, ImagePixelPackEnum bpp = ImagePixelPackEnum.BPP4, ImageEndianTypeEnum endian = ImageEndianTypeEnum.BigEndian, ImageRotateEnum rotate = ImageRotateEnum.Rotate0, DisplayModeEnum mode = DisplayModeEnum.GC16) { var p = new DrawingBuffer(x, y, width, height, bpp); pixelOperateCallback(p); device.LoadImageArea(bpp, endian, rotate, p.Buffer.Span, x, y, width, height); device.RefreshArea(mode, x, y, width, height); }
public static void Draw(this IT8951SPIDevice device, Action <DrawingBuffer> pixelOperateCallback, ImagePixelPackEnum bpp = ImagePixelPackEnum.BPP4, ImageEndianTypeEnum endian = ImageEndianTypeEnum.BigEndian, ImageRotateEnum rotate = ImageRotateEnum.Rotate0, DisplayModeEnum mode = DisplayModeEnum.GC16) { var p = new DrawingBuffer(device, bpp); pixelOperateCallback(p); if (bpp == ImagePixelPackEnum.BPP1) { device.LoadImageArea(ImagePixelPackEnum.BPP8, endian, rotate, p.Buffer.Span, 0, 0, (ushort)(device.DeviceInfo.ScreenSize.Width / 8), (ushort)device.DeviceInfo.ScreenSize.Height); device.Set1BPPMode(true); device.RefreshScreen(DisplayModeEnum.A2); device.Set1BPPMode(false); } else { device.LoadImage(bpp, endian, rotate, p.Buffer.Span); device.RefreshScreen(mode); } }
public static void LoadImageArea(this IT8951SPIDevice device, ImagePixelPackEnum bpp, ImageEndianTypeEnum endian, ImageRotateEnum rotate, Span <byte> pixelBuffer, ushort x, ushort y, ushort width, ushort height, ushort displayBufferAddressOffset = 0) { device.WaitForDisplayReady(TimeSpan.FromSeconds(5)); device.SetTargetMemoryAddress(device.DeviceInfo.BufferAddress + displayBufferAddressOffset); device.LoadImageAreaStart(endian, bpp, rotate, x, y, width, height); device.SendBuffer(pixelBuffer); device.LoadImageEnd(); }
public static void LoadImage(this IT8951SPIDevice device, ImagePixelPackEnum bpp, ImageEndianTypeEnum endian, ImageRotateEnum rotate, Span <byte> pixelBuffer) { device.WaitForDisplayReady(TimeSpan.FromSeconds(5)); device.SetTargetMemoryAddress(device.DeviceInfo.BufferAddress); device.LoadImageStart(endian, bpp, rotate); device.SendBuffer(pixelBuffer); device.LoadImageEnd(); }
public void LoadImageAreaStart(ImageEndianTypeEnum endtype, ImagePixelPackEnum pixelPack, ImageRotateEnum rotate, ushort x, ushort y, ushort width, ushort height) { ushort v = (ushort)((ushort)endtype | (ushort)pixelPack | (ushort)rotate); io.SendCommand(IT8951SPIDeviceIO.DeviceCommand.LD_IMG_AREA, v, x, y, width, height); }
public void LoadImageStart(ImageEndianTypeEnum endtype, ImagePixelPackEnum pixelPack, ImageRotateEnum rotate) { ushort v = (ushort)((ushort)endtype | (ushort)pixelPack | (ushort)rotate); io.SendCommand(IT8951SPIDeviceIO.DeviceCommand.LD_IMG, v); }