Skip to content

初始化绝对坐标系统

将光标移动到屏幕左上角,并告知设备当前屏幕分辨率。

语法

cpp
class RX784::Device {
    Status initAbsSystem(
        int16_t screenWidth,
        int16_t screenHeight
    );
};
class RX784::Device {
    Status initAbsSystem(
        int16_t screenWidth,
        int16_t screenHeight
    );
};
e
类名基类公开备注
RX784设备
方法名返回值类型公开备注
初始化绝对坐标系统整数型
参数名类型参考可空数组备注
屏幕宽度短整数型
屏幕高度短整数型
.版本 2 .程序集 RX784设备, , 公开 .子程序 初始化绝对坐标系统, 整数型, 公开 .参数 屏幕宽度, 短整数型 .参数 屏幕高度, 短整数型
py
class Device:
    def init_abs_system(self,
        screen_width:  int,
        screen_height: int
    ) -> Status: ...
class Device:
    def init_abs_system(self,
        screen_width:  int,
        screen_height: int
    ) -> Status: ...

参数

名称英文说明
屏幕宽度screen width集线器输出端连接的屏幕的宽度,单位为像素
屏幕高度screen height集线器输出端连接的屏幕的高度,单位为像素

返回值

名称英文说明
状态码status成功返回

备注

使用绝对坐标 API 前必须先初始化绝对坐标系统。

示例

cpp
#include "rx784.hpp"

int main() {
    RX784::Device device;

    device.open("COM1");

    device.initAbsSystem(1920, 1080);
    device.moveAbs(123, 456);  // 移动到屏幕坐标 (123, 456) 处

    device.close();
}
#include "rx784.hpp"

int main() {
    RX784::Device device;

    device.open("COM1");

    device.initAbsSystem(1920, 1080);
    device.moveAbs(123, 456);  // 移动到屏幕坐标 (123, 456) 处

    device.close();
}
e
方法名返回值类型公开备注
_启动子程序整数型
变量名类型静态数组备注
设备RX784设备
设备.打开 (“COM1”)
设备.初始化绝对坐标系统 (1920, 1080)
设备.绝对移动 (123, 456) ' 移动到屏幕坐标 (123, 456) 处
设备.关闭 ()
返回 (0)
.版本 2 .子程序 _启动子程序, 整数型 .局部变量 设备, RX784设备 设备.打开 (“COM1”) 设备.初始化绝对坐标系统 (1920, 1080) 设备.绝对移动 (123, 456) ' 移动到屏幕坐标 (123, 456) 处 设备.关闭 () 返回 (0)
py
import rx784

device = rx784.Device()

device.open('COM1')

device.init_abs_system(1980, 1040)
device.move_abs(123, 456)  # 移动到屏幕坐标 (123, 456) 处

device.close()
import rx784

device = rx784.Device()

device.open('COM1')

device.init_abs_system(1980, 1040)
device.move_abs(123, 456)  # 移动到屏幕坐标 (123, 456) 处

device.close()