这段程序的代码如下:
VMINT8 * buf;
VMWCHAR str[20];
layer_hdl[1] = vm_graphic_create_layer( 40, 140, 160, 80, VM_COLOR_888_TO_565(200,200,200) );
//vm_graphic_set_clip();
buf = vm_graphic_get_layer_buffer ( layer_hdl[1] );
//vm_graphic_fill_roundrect ( buf, 0, 0, 160, 80, 5, VM_COLOR_888_TO_565(200,200,200) );
vm_graphic_fill_rect ( buf, 0, 0, 160, 80, VM_COLOR_WHITE, VM_COLOR_888_TO_565(200,200,200) );
//vm_graphic_textout (buf, (ScreenWidth-vm_graphic_get_string_width(str))/2,
// (ScreenHeight-vm_graphic_get_character_height())/2, str, wstrlen(str), VM_COLOR_RED );
//draw Yes corn画Yes按钮
vm_graphic_fill_roundrect ( buf, 50-40, 190-140, 50, 20, 2, VM_COLOR_888_TO_565(150,150,150) );
vm_graphic_line ( buf, (50+2 -40), (190+20+1-140), (50+50-1-40), (190+20+1-140), VM_COLOR_BLACK ); //因为新建layer 1,减去最初设在基层上的偏移量
vm_graphic_line ( buf, (50+2 -40), (190+20+0-140), (50+50-1-40), (190+20+0-140), VM_COLOR_BLACK );
vm_graphic_line ( buf, (50+50+1-40), (190+2 -140), (50+50+1-40), (190+20-2-140), VM_COLOR_BLACK );
vm_graphic_line ( buf, (50+50+0-40), (190+2 -140), (50+50+0-40), (190+20-2-140), VM_COLOR_BLACK );
vm_ascii_to_ucs2(str,20,"是(Y)");
vm_graphic_textout(buf, 50+(50-vm_graphic_get_string_width(str))/2-40, 190+3-140, str, wstrlen(str), VM_COLOR_888_TO_565(255, 155,0) );
//draw Yes corn画Yes按钮
vm_graphic_fill_roundrect ( buf, ScreenWidth-50-50, 190, 50, 20, 2, VM_COLOR_888_TO_565(150,150,150) );
vm_graphic_line ( buf, (ScreenWidth-(50+1)-40), (190+20+1-140), (ScreenWidth-(50+50-2)-40), (190+20+1-140), VM_COLOR_BLACK );
vm_graphic_line ( buf, (ScreenWidth-(50+1)-40), (190+20+0-140), (ScreenWidth-(50+50-2)-40), (190+20+0-140), VM_COLOR_BLACK );
vm_graphic_line ( buf, (ScreenWidth-(50+1)-40), (190+2 -140), (ScreenWidth-(50+1) -40), (190+20-2-140), VM_COLOR_BLACK );
vm_graphic_line ( buf, (ScreenWidth-(50+0)-40), (190+2 -140), (ScreenWidth-(50+0) -40), (190+20-2-140), VM_COLOR_BLACK );
vm_ascii_to_ucs2(str,20,"否(N)");
vm_graphic_textout(buf, ScreenWidth-50-50+(50-vm_graphic_get_string_width(str))/2-40, 190+3-140, str, wstrlen(str), VM_COLOR_888_TO_565(255, 155,0) );
vm_ascii_to_ucs2(str,20,"确定退出?");
vm_graphic_textout( buf, 20, ( 80-vm_graphic_get_character_height() )/2, str, wstrlen(str), VM_COLOR_888_TO_565(255, 155,0) );
vm_graphic_set_layer_opacity(layer_hdl[1],50); //set opacity of fast layer
//draw_text("确定退出?", (ScreenHeight-vm_graphic_get_character_height())/2, 0 );
vm_graphic_flush_layer( layer_hdl, 2 );
我要赚赏金打赏帖 |
|
|---|---|
| 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元 | |
我要赚赏金
