|
写了两个写文本到LCD的函数,可以用在不方便使用cather抓LOG的情况,比如耳机与下载线共用端口时调试耳机的插入与拔出的运行情况,希望对大家有帮助,也希望达人指教。
void PrintDebugInfo2ScrnById(U16 StringId )
{
S32 lcd_width;
S32 lcd_height;
gdi_handle layer_handle;
PS8 str_ptr = (PS8) GetString(StringId);
gdi_layer_reset_text_clip();
gdi_lcd_get_dimension(&lcd_width, &lcd_height);
gdi_layer_get_active(&layer_handle);
gdi_layer_clear_background(GDI_COLOR_RED);
gui_set_font(&MMI_medium_font);
gui_move_text_cursor(0, 20);
gui_set_text_color(gui_color(255, 255, 255));
gui_print_text((UI_string_type)str_ptr);
gdi_layer_blt(layer_handle, 0, 0, 0, 0, 0, lcd_width - 1, lcd_height - 1);
}
// pAnsiStr should less than 256 ascii character
void PrintDebugInfo2ScrnByStr(char *pAnsiStr )
{
S32 lcd_width;
S32 lcd_height;
gdi_handle layer_handle;
S8 str_ptr[512] = {0};
if( strlen(pAnsiStr) > 255 )
{
return;
}
AnsiiToUnicodeString( str_ptr, (S8*) pAnsiStr);
gdi_layer_reset_text_clip();
gdi_lcd_get_dimension(&lcd_width, &lcd_height);
gdi_layer_get_active(&layer_handle);
gdi_layer_clear_background(GDI_COLOR_RED);
gui_set_font(&MMI_medium_font);
gui_move_text_cursor(0, 20);
gui_set_text_color(gui_color(255, 255, 255));
gui_print_text((UI_string_type)str_ptr);
gdi_layer_blt(layer_handle, 0, 0, 0, 0, 0, lcd_width - 1, lcd_height - 1);
} |
|