version:8.3
I want to achieve pipeline flow like this
It can be set to flow direction, rotated, and set line segment thickness.
I tried to use img, but it could not be set line segment thickness and rotated.
Please tell me how to implement it.
I want to achieve pipeline flow like this
It can be set to flow direction, rotated, and set line segment thickness.
I tried to use img, but it could not be set line segment thickness and rotated.
Please tell me how to implement it.
I dont test only my tip, create image with line and space one thickness.
Create obj filled with tiled image.
Create horizontal animation. Simmilar for vertical.
Angled is more complicated.
Thanks, image is useful.
void draw_line_animation(lv_obj_t *parent, lv_obj_t *line, struct CanvasLine lineInfo, line_animation dir) {
line = lv_img_create(parent);
lv_img_set_src(line, &line_hor_70_800);//图片分辨率设置足够大,可以通过设置图片对象尺寸从而实现线段粗细的控制
lv_obj_set_height(line, lineInfo.width);
lv_obj_set_width(line, lineInfo.length);
}
lv_obj_set_pos(line, lineInfo.startPoint.x, lineInfo.startPoint.y);
//lv_img_set_size_mode(line, LV_IMG_SIZE_MODE_REAL);
//lv_img_set_zoom(line, lineInfo.width * 128);
if (dir == LINE_ANIMATION_STOP)
return;
lv_anim_t a2;
lv_anim_init(&a2);
lv_anim_set_var(&a2, line);
if (lineInfo.type == 0)
lv_anim_set_exec_cb(&a2, ofs_x_anim);
else if (lineInfo.type == 1)
lv_anim_set_exec_cb(&a2, ofs_y_anim);
lv_anim_set_time(&a2, (lineInfo.length / lineWidth) * 2000 * 3);
lv_anim_set_repeat_count(&a2, LV_ANIM_REPEAT_INFINITE);
if (dir == LINE_ANIMATION_FORWORD)
lv_anim_set_values(&a2, 0, lineInfo.length * 3);
else if (dir == LINE_ANIMATION_REVERSE)
lv_anim_set_values(&a2, lineInfo.length * 3, 0);
lv_anim_start(&a2);
}
But no rotation was achieved