Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// fills the chosen rectangle with a color in 0x00RRGGBB format
        /// </summary>
        public async Task FillRect(ushort x, ushort y, ushort w, ushort h, uint color)
        {
            var opcode = new OpcodeData(0xA2, x, y, w, h);

            opcode._wColor(color);
            await _send(opcode);
        }
Ejemplo n.º 4
0
        /// <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);
        }