/// <summary> /// Sets the mouse cursor. Probably cbitmap switches between bg and fg, mbitmap is transparency? /// </summary> public async Task SetMouseCursor(ushort x, ushort y, ushort w, ushort h, uint bg, uint fg, byte[] cbitmap, byte[] mbitmap) { Debug.Assert(cbitmap.Length == (w * h) >> 4); Debug.Assert(mbitmap.Length == (w * h) >> 4); var opcode = new OpcodeData(0xA9, x, y, w, h); opcode._wColor(bg); opcode._wColor(fg); opcode._write(cbitmap); opcode._write(mbitmap); opcode._wPad(4); await _send(opcode); }
/// <summary> /// Blits a bitmap. Pixel order is BGR here! /// </summary> public async Task BlitBitmap(ushort x, ushort y, ushort w, ushort h, byte[] data) { var opcode = new OpcodeData(0xA6, x, y, w, h); opcode._write(data); opcode._wPad(4); await _send(opcode); }
/// <summary> /// Writes a 1-color bitmap, background transparent. Format is horizontal, then vertical, with rows padded out to full bytes. /// </summary> public async Task MaskedFill(ushort x, ushort y, ushort w, ushort h, uint color, byte[] bitmap) { var opcode = new OpcodeData(0xA3, x, y, w, h); opcode._wColor(color); opcode._write(bitmap); opcode._wPad(4); await _send(opcode); }
/// <summary> /// Writes a 2-color bitmap. Format is horizontal, then vertical, with rows padded out to full bytes. /// </summary> public async Task ExpandBitmap(ushort x, ushort y, ushort w, ushort h, uint bg, uint fg, byte[] bitmap) { Debug.Assert(bitmap.Length == (w + 7) / 8 * h); var opcode = new OpcodeData(0xA5, x, y, w, h); opcode._wColor(bg); opcode._wColor(fg); opcode._write(bitmap); opcode._wPad(4); await _send(opcode); }