MTK图形图象函数

相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

1、S32 gdi_image_draw_id(S32 offset_x, S32

offset_y, U16 image_id);

offset_x和offset_y 是图片左上角的坐标,image_id是指向图片的枚举类

型,

用法如下:

ADD_APPLICATION_IMAGE(MAIN_MENU_MA TRIX_PHONEBOOK_ICON,CUST_IM

G_PATH"\\\\MainLCD\\\\MainMenu\\\\MATRIX\\\\MM_PB.gif");

2、S32 gdi_image_draw(S32 offset_x, S32 offset_y, U8 *image_ptr);

Image_ptr是用file2hex.exe转化后的图片文件名;

在MTK平台里,image_ptr = (U8*)GetImage(image_id);

3、S32 gdi_image_draw_file(S32 offset_x, S32 offset_y, S8

*image_name);

Image_name是图片的文件名;

4、S32 gdi_image_get_dimension_id(U16 image_id, S32 *width, S32

*height);

S32 gdi_image_get_dimension_file(S8 *image_name, S32 *width, S32

*height);

S32 gdi_image_get_dimension(U8 *image_ptr, S32 *width, S32 *height);

获得图片的长宽参数

5、S32 gdi_image_get_frame_count_id(U16 image_id, S32 *frame_count); S32 gdi_image_get_frame_count_id(U16 image_id, S32 *frame_count);

获得动态图片的帧数

画点函数;

6、void UI_putpixel(s32 x,s32 y,color c);

7、关于剪切矩形:

void UI_set_clip(s32 x1,s32 y1,s32 x2,s32 y2);

void UI_reset_clip(void);

void UI_pop_clip(void);

void UI_set_text_clip(s32 x1,s32 y1,s32 x2,s32 y2);

void UI_reset_text_clip(void);

void UI_pop_text_clip(void);

画线函数;

颜色为c的一条直线:

void UI_line(s32 x1,s32 y1,s32 x2,s32 y2,color c);

颜色为c,宽度为w的一条直线:

void UI_wline(s32 x1,s32 y1,s32 x2,s32 y2,color c,s32 w);

画一个空心矩形:

void UI_draw_rectangle(s32 x1,s32 y1,s32 x2,s32 y2,color c); 填充一个矩形:

void UI_fill_rectangle(s32 x1,s32 y1,s32 x2,s32 y2,color c); 画图区域控制函数:

void UI_lock_double_buffer(void);

void UI_unlock_double_buffer(void);

void UI_BLT_double_buffer(s32 x1, s32 y1, s32 x2 , s32 y2); 文字输出有关的函数:

设置字符显示区:

void UI_set_text_clip(s32 x1,s32 y1,s32 x2,s32 y2);

设置字体颜色:

void UI_set_text_color(color c);

设置字体边框颜色:

void UI_set_text_border_color(color c);

设置当前光标位置:

void UI_move_text_cursor(s32 x,s32 y);

获取字符串的长、宽参数:

void UI_measure_string(UI_string_type text,s32 *width,s32 *height);

获得单个字符的长、宽参数:

void UI_measure_character(UI_character_type c,s32 *width,s32

*height);

输出字符串:

void UI_print_text(UI_string_type text);

输出一个字符:

void UI_print_character(UI_character_type c);

字符串求长:

U16 UTF8Strlen(U8 *p);

字符串操作函数:

字符串查找:strstr

字符串拷贝:strcpy

字符串定长拷贝:strncpy

字符串比较:strcmp

字符串定长比较:strncmp

字符串续接:strcat

字符串定长续接:strncat

字符串转化为整型函数:atoi

整型转化为字符串函数:itoa

关于层

建立一个层:

GDI_RESULT dm_create_layer_using_outside_memory(S32 x, S32 y, S32 width, S32 height, gdi_handle **handle_ptr, U8 *outside_memory, S32 outside_memory_size, U32 flags);

MTK平台上,软件支持四层。

获取base layer,即最下面的层:

GDI_RESULT gdi_layer_get_base_handle(gdi_handle *handle_ptr);

将层压栈并激活,执行此条语句后,可以对该层操作,

void gdi_layer_push_and_set_active(gdi_handle handle);

操作完成后,用下面的函数让该层出栈:

void gdi_layer_pop_and_restore_active(void);

最后用函数

相关文档
最新文档