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讨论,欢迎指出错误~
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |