Skip to content

GetBlock

函数原型

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

功能

取屏幕图形

说明

把屏幕或图形缓冲区的 (x, y) 坐标处的宽为 width 高 height 的矩形区域保存到内存地址 data 处。

type 参数的含义如下:

  • type = 0: 从图形缓冲区取图形
  • type = 0x40: 从屏幕取图形

注意:x 和 width 忽略 bit0-bit2。

示例

c
void main()
{
    char data[16];

    Locate(0, 1);
    putchar('V');
    GetBlock(8, 0, 8, 16, 0x40, data);
    WriteBlock(80, 40, 8, 16, 0x41, data);
    getchar();
}