绘制矩形 - DrawGuiRectangle
函数简介
创建矩形绘制对象,支持填充/描边模式与线宽设置。
接口名称
DrawGuiRectangle
DLL调用
int64_t DrawGuiRectangle(int64_t instance, int32_t x, int32_t y,
int32_t width, int32_t height, int32_t mode,
double lineThickness);
参数说明
参数名 | 类型 | 说明 |
---|---|---|
instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
x | 整数型 | 左上角X。 |
y | 整数型 | 左上角Y。 |
width | 整数型 | 宽度。 |
height | 整数型 | 高度。 |
mode | 整数型 | 绘制模式,见 DrawMode。 |
lineThickness | 双精度型 | 线宽(像素),对描边模式有效。 |
示例
int64_t ola = CreateCOLAPlugInterFace();
int64_t r = DrawGuiRectangle(ola, 100, 100, 200, 120, 1, 2.0);
// ...
DestroyCOLAPlugInterFace(ola);
返回值
对象句柄,失败返回0。
注意事项
- 颜色、透明度等可通过属性设置接口进行配置。