找回密码
 注册
搜索
查看: 709|回复: 2

[MTK开发]请问各位大侠如何才能实现菜单项透明显示在一张背景图上

[复制链接]
发表于 2010-12-21 14:43:23 | 显示全部楼层 |阅读模式
void ShowCategory9999creen()
{
...
    EntryNewScreen(MY_SREEN1, show_screen_exit, ShowCategory9999creen, NULL) ;
    //锁屏计数器加1
    gdi_layer_lock_frame_buffer();
   
    //进入全屏模式
    entry_full_screen() ;
    clear_screen() ;
    //绘制背景图片
    gdi_image_draw(0, 0, GetImage(IMG_SCREEN_ROTATE_BACKGROUND)) ;
    //创建一个新的用户层.
    gdi_layer_create(0, 0, UI_device_width, UI_device_height, &g_myLayer) ;
    //激活用户层
    gdi_layer_set_active( g_myLayer) ;
   
    //设置层的通透色
    gdi_layer_clear(GDI_COLOR_BLUE) ;
    //将层设置成通透
    gdi_layer_set_source_key(TRUE, GDI_COLOR_BLUE) ;
    //设置半透明效果
    gdi_layer_set_opacity(TRUE, 100) ;   
    display_news_menu_item_title(g_news_class[g_item_class_index], v_acNewsClassTitle, NEWS_TITLE_LEN,         title_item_index,  hilight_show_a_detail_news);

   
    SetLeftSoftkeyFunction(open_new_link_in_explorer, KEY_EVENT_DOWN) ;
    SetKeyHandler(open_new_link_in_explorer, KEY_LSK, KEY_EVENT_DOWN) ;  
    //锁屏计数器 - 1
    //得到基础层句柄
    gdi_layer_get_base_handle(&baseHandle) ;
    //还原基础层为当前激活层.
    gdi_layer_set_active(baseHandle) ;
    //函数gdi_layer_restore_base_active(void);与上面两句的功能一致.
    //gdi_layer_restore_base_active(void);
    //锁屏计数器-1
    gdi_layer_unlock_frame_buffer();   
    //设置合并层顺序
    gdi_layer_set_blt_layer(baseHandle, g_myLayer, NULL, NULL);
        //刷新屏幕
    gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1) ;       
   
}

但是这样做并没有实现菜单透明效果,
小弟跪求各位MTK的大侠们, 请问应该如何实现透明效果呢? 在此先谢谢大家了

注:附件为运行结果抓图.
 楼主| 发表于 2010-12-22 18:13:02 | 显示全部楼层
...
我的问题是不是没有说清楚...
怎么没有人理我啊~
点评回复

使用道具 举报

 楼主| 发表于 2010-12-21 14:46:38 | 显示全部楼层
补充一下:
display_news_menu_item_title功能是
先显示标题,后显示菜单
代码如下:
display_news_menu_item_title()
{
    ...
    gui_print_text(p_menu_title) ;
   
    //开始显示菜单
    move_fixed_list(0, MMI_content_y + 5) ;
    resize_fixed_list(UI_device_width - 1, UI_device_height - MMI_content_y -5 ) ;
    MMI_current_menu_type           = LIST_MENU ;
    //disable_menu_short_box_display  = 1 ;
    //初始化公共数据
    create_fixed_icontext_menuitems() ;
    //联合菜单框架与菜单项
    associate_fixed_icontext_list();
    //初始化单项数据
    for (listIndex = 0; listIndex < p_num_if_menu_items; listIndex++)
    {
       add_fixed_icontext_item(p_menu_items + listIndex * p_each_item_len, NULL);
        
    }
    ...
}
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-10-8 01:24 , Processed in 0.044264 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表