VMINT vm_graphic_create_layer(
VMINT x,
VMINT y,
VMINT width,
VMINT height,
VMINT trans_color
);
Description
Create layer.layer is the simulation for LCD.
创造层,这里的层就相当于LCD(显示屏)的模拟
using this api, user can create two layers at most, and user needn't to require additional memory for it.
使用该API,用户最多可以创建两层,且无须为该函数申请额外的内存
layer 0: same with LCD's size and position. it means, top left coordination must be (0,0), width = screen width and height = screen height
第0层(也即基层)和LCD的大小,位置相同,也就是说,左上角坐标必须为(0,0),宽等于屏幕宽度,高等于屏幕高度
layer 1: user can set the opacity, position,size(can not larger than LCD's size).
第1层:用户可以设置不透明度(即所谓的Alpha值),大小(不能大于LCD的尺寸)
the two layers can be merged with the appointed opacity
这两层可以用指定的不透明度来合并
Parameters(参数)
Parameters Description 参数描述
VMINT x [IN]x_top left coordination 左上的X坐标
VMINT y [IN]y_top left coordination 左上的Y坐标
VMINT width [IN] the width of the layer, the unit:pixel 层的宽度,单位:像素
VMINT height [IN]the height of the layer, the unit:pixel层的高度,单位:像素
VMINT trans_color [IN]the transparent color. -1 means no transparent color. 透明颜色,-1表示没有透明色
Returns
if succeed, return the layer handle, if fail, return the error code
如果调用成功,返回层句柄,如果失败,返回错误代码
Example 举例
VMINT layer_hdl[2] = {0};
layer_hdl[0] = vm_graphic_create_layer(0, 0, vm_graphic_get_screen_width(), vm_graphic_get_screen_height(), VM_NO_TRANS_COLOR);
//user can draw on the layer
vm_graphic_line_ex( layer_hdl[0],0,0,100,100);
....
// when need to show it to the LCD
vm_graphic_flush_layer( layer_hdl[0], 1);
//when no more use the layer, delete it
vm_graphic_delete_layer(layer_hdl[0]);
File
vmgraph.h
须包含头文件:vmgraph.h
本函数由VRE论坛http://vre.net.ru翻译,如有疑问,请加群103430901讨论,欢迎指出错误~
我要赚赏金打赏帖 |
|
|---|---|
| OK1126B-S开发板下以导航按键控制云台/机械臂姿态调整被打赏¥29元 | |
| 【树莓派5】便携热成像仪被打赏¥36元 | |
| 【树莓派5】环境监测仪被打赏¥35元 | |
| OK1126B-S开发板下多时段语音提示型电子时钟被打赏¥27元 | |
| OK1126B-S开发板下函数构建及步进电机驱动控制被打赏¥25元 | |
| 【S32K3XX】LPI2C 参数配置说明被打赏¥20元 | |
| OK1126B-S开发板的脚本编程及应用设计被打赏¥27元 | |
| 5v升压8.4v两节锂电池充电芯片,针对同步和异步的IC测试被打赏¥35元 | |
| 【S32K3XX】S32DS LPI2C 配置失败问题解决被打赏¥22元 | |
| 【S32K3XX】FLASH 的 DID 保护机制被打赏¥19元 | |
我要赚赏金
