跳至主要內容

WriteBlock


WriteBlock

函数原型

void WriteBlock(int x, int y, int width, int height, int type, addr data);

功能

把位图绘制到屏幕缓冲区

说明

在屏幕的 (x, y) 坐标处绘图,图的宽为 width,高为 height,图形的数据地址为 data。

type 参数的含义如下:

  • bit6 = 1: 直接在屏幕上绘图
  • bit3 = 1: 图形的所有点取反
  • bit2-0:
    • 1: copy
    • 2: not
    • 3: or
    • 4: and
    • 5: xor
    • 6: 透明copy(仅用于256色模式)

示例

char fa[] = {
    0xff, 0xe0, 0x80, 0x20, 0xbb, 0xa0, 0x8a, 0x20,
    0x91, 0x20, 0xa0, 0xa0, 0xbb, 0xa0, 0x8a, 0xa0,
    0xba, 0xa0, 0xa0, 0x20, 0xbb, 0xa0, 0x8a, 0xa0,
    0x89, 0x20, 0xba, 0xa0, 0x80, 0x20, 0xff, 0xe0
};

void main()
{
    ClearScreen();
    WriteBlock(60, 30, 11, 16, 1, fa);
    WriteBlock(80, 30, 11, 16, 2, fa);
    Refresh();
    getchar();
}