这段程序的代码如下:
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 );
关键词:
急问
为什么
利用
透明
绘制
对话框
而又
显示