这段程序的代码如下:
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 );
打赏帖 | |
---|---|
分享一种检测按键状态的方法被打赏20分 | |
周末总结一下,STM32C0系列的开发经验被打赏50分 | |
【Cortex-M】Systick Timer使用被打赏10分 | |
分享汽车防盗系统的组成与分类(一)被打赏5分 | |
VOFA+波形显示+JYD-31蓝牙发送和解析不定长数据被打赏10分 | |
【换取手持数字示波器】-STM32F4PWM控制LED灯管亮度被打赏22分 | |
【换取手持数字示波器】STM32F4驱动RPR-0521RS照度、接近一体型传感器被打赏23分 | |
宏定义和const关键字定义被打赏5分 | |
【分享开发笔记,赚取电动螺丝刀】几个单片机I2S外设的BLCK时钟对比被打赏20分 | |
【功率监测与控制系统DIY活动成果贴】DIY功率计与LabVIEW数据采集被打赏100分 |