50 lines
1.3 KiB
C
50 lines
1.3 KiB
C
#include "include.h"
|
|
|
|
#define TRACE_EN 0
|
|
|
|
#if TRACE_EN
|
|
#define TRACE(...) printf(__VA_ARGS__)
|
|
#else
|
|
#define TRACE(...)
|
|
#endif
|
|
|
|
//创建一个图像框组件
|
|
compo_picturebox_t *compo_picturebox_create(compo_form_t *frm, u32 res_addr)
|
|
{
|
|
compo_picturebox_t *picbox = compo_create(frm, COMPO_TYPE_PICTUREBOX);
|
|
void *img = widget_image_create(frm->page, res_addr);
|
|
picbox->img = img;
|
|
return picbox;
|
|
}
|
|
|
|
//设置图像
|
|
void compo_picturebox_set(compo_picturebox_t *picbox, u32 res_addr)
|
|
{
|
|
widget_image_set(picbox->img, res_addr);
|
|
}
|
|
|
|
//设置图像框组件的坐标
|
|
void compo_picturebox_set_pos(compo_picturebox_t *picbox, s16 x, s16 y)
|
|
{
|
|
widget_set_pos(picbox->img, x, y);
|
|
}
|
|
|
|
//设置图像框组件的大小
|
|
void compo_picturebox_set_size(compo_picturebox_t *picbox, s16 width, s16 height)
|
|
{
|
|
widget_set_size(picbox->img, width, height);
|
|
}
|
|
|
|
//设置图像框的旋转角度
|
|
void compo_picturebox_set_rotation(compo_picturebox_t *picbox, s16 angle)
|
|
{
|
|
widget_image_set_rotation(picbox->img, angle);
|
|
}
|
|
|
|
//设置图像框的旋转中心点
|
|
void compo_picturebox_set_rotation_center(compo_picturebox_t *picbox, s16 x, s16 y)
|
|
{
|
|
widget_image_set_rotation_center(picbox->img, x, y);
|
|
}
|
|
|