forked from aromadev/libaroma
-
Notifications
You must be signed in to change notification settings - Fork 0
ctl_indicator
Ever-Never edited this page Jul 9, 2018
·
1 revision
indicator的添加,
1、支持圆形的显示屏和方型显示屏,位置固定在屏幕的右边,并且固定大小;
2、支持设置indicator的颜色、个数;
LIBAROMA_CONTROLP libaroma_ctl_indicator(LIBAROMA_WINDOWP win,byte count,lcdtype type)
参数 | 说明 |
---|---|
win | 对应的win |
count | indicator包含的元素个数(例如:如果需要指示5个页面,则有5个元素,这里填5) |
type | 支持在方形和圆形显示屏:CIRCLE、SQUARE |
byte libaroma_ctl_indicator_set_position(LIBAROMA_CONTROLP ctl,byte position,word color)
参数 | 说明 |
---|---|
ctl | indicator控件 |
position | 想高亮显示的元素位置点 |
color | indicator元素的颜色 |
注意、indicator不能单独使用,win必须要有其它的ctl在运行,才能显示indicator,下面是使用例子:
LIBAROMA_WINDOWP win = libaroma_window(NULL, 0, 0, LIBAROMA_SIZE_FULL,
LIBAROMA_SIZE_FULL); /* fullscreen */
LIBAROMA_CONTROLP image2 = libaroma_ctl_image(win, 3, NULL,libaroma_dp(0), libaroma_px(0), win->w, win->h);
byte index[10]={4,2,0,5,7,6,8,9,12,20};
libaroma_ctl_image_set_animation(image2,(char *)png_res,index, 1, 1,1,test_start_cb,test_repeat_cb,NULL);
libaroma_ctl_image_animation_set_play_or_stop(image2,1);
libaroma_ctl_image_animation_set_repeat( image2 ,3);
indicator= libaroma_ctl_indicator(win, 9,0xff,0);
libaroma_ctl_indicator_set_position(indicator,3,RGB(ffffff));