【MTK】为什么我的屏幕裁剪不成功哦
gdi_handle mu_layer;
void ShowCategoryMuScreen()
{
stFontAttribute f={0};
gdi_handle base_layer;
//初始化屏幕
EntryNewScreen(SCR_MUAPP_MAIN, mmi_muapp_exit, NULL, NULL);
gui_lock_double_buffer();
entry_full_screen();
clear_screen();
gui_line(5, 47, 235,47, UI_COLOR_BLACK);
gdi_layer_create(0, 0, 240, 400, &mu_layer);
gdi_layer_set_active(mu_layer);
gdi_layer_clear(GDI_COLOR_BLUE);
gdi_layer_set_source_key(TRUE, GDI_COLOR_BLUE);
gdi_layer_push_clip();
gdi_layer_set_clip(0, 47, 235, 107);
gdi_layer_pop_clip();
gdi_layer_set_opacity(TRUE, 128);
gdi_layer_get_base_handle(&base_layer);
gdi_layer_set_active(base_layer);
gdi_layer_set_blt_layer(base_layer, mu_layer, NULL, NULL);
gui_unlock_double_buffer();
gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
SetKeyHandler(GoBackHistory, KEY_RSK, KEY_EVENT_UP);
}
[解决办法]
我不懂MTK,但按常理来看
gdi_layer_push_clip();//保存裁剪区设置
gdi_layer_set_clip(0, 47, 235, 107);//设置自己的裁剪区
......//这里插入需要裁剪的绘图代码
gdi_layer_pop_clip();//恢复以前的裁剪区