当前位置:网站首页>Lvgl 8.2 picture scaling and rotation
Lvgl 8.2 picture scaling and rotation
2022-06-30 10:54:00 【Fairy sword love】
The animation callback function sets the angle
static void set_angle(void* img, int32_t v)
{
lv_img_set_angle(img, v);
}
The animation callback function sets the zoom size
static void set_zoom(void* img, int32_t v)
{
lv_img_set_zoom(img, v);
}
establish Image And zoom , Rotate the picture
/** * Show transformations (zoom and rotation) using a pivot point. */
static void lv_example_img_3(void)
{
LV_IMG_DECLARE(img_cogwheel_argb); // Picture resource statement
/*Now create the actual image*/
lv_obj_t* img = lv_img_create(lv_scr_act()); // establish Image object
lv_img_set_src(img, &img_cogwheel_argb); // Set the displayed picture source
lv_obj_align(img, LV_ALIGN_CENTER, 50, 50); // Center offset 50,50 Align at
lv_img_set_pivot(img, 0, 0); // around Image Rotate the upper left corner of the object
lv_anim_t a;
lv_anim_init(&a); // Initializing animation variables
lv_anim_set_var(&a, img); // Animate the associated objects img
lv_anim_set_exec_cb(&a, set_angle); // Set the callback function for animation execution set_angle
lv_anim_set_values(&a, 0, 3600); // Set the range of animation , Here is the angle 0~360 degree
lv_anim_set_time(&a, 5000); // Animate duration Time 5000 millisecond
lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE);// Set the number of animation repetitions , Here is infinite times
lv_anim_start(&a); // Start animation playback
lv_anim_set_exec_cb(&a, set_zoom); // Set the animation to execute the callback function set_zoom
lv_anim_set_values(&a, 128, 256); // Set the range of animation , Here is the zoom ratio 128~256
lv_anim_set_playback_time(&a, 3000); // Set the animation replay time 3000 millisecond
lv_anim_start(&a); // Start animation playback
}
Running effect

边栏推荐
- Unity Shader - 踩坑 - BRP 管线中的 depth texture 的精度问题(暂无解决方案,推荐换 URP)
- Q-Learning笔记
- Turn to cartoon learning notes
- 数据库什么时候需要使用索引【杭州多测师】【杭州多测师_王sir】
- LVGL 8.2 Image
- Voir le changement technologique à travers la Légion Huawei (5): Smart Park
- 透过华为军团看科技之变(五):智慧园区
- go-zero微服务实战系列(八、如何处理每秒上万次的下单请求)
- Typescript – classes in Es5, inheritance, static methods
- MATLAB image histogram equalization, namely spatial filtering
猜你喜欢

The intelligent DNA molecular nano robot model is coming
![When does the database need to use the index [Hangzhou multi surveyors] [Hangzhou multi surveyors _ Wang Sir]](/img/2a/f07a7006e0259d78d046b30c761764.jpg)
When does the database need to use the index [Hangzhou multi surveyors] [Hangzhou multi surveyors _ Wang Sir]

文件共享服务器

Deep dive kotlin synergy (16): Channel

20万奖金池!【阿里安全 × ICDM 2022】大规模电商图上的风险商品检测赛火热报名中!...

Sarsa笔记

Using LVM to resize partitions

Mysql database foundation: views and variables
[email protected] intelligent instrument teaching aids based on 51 series single chip microcomputer"/>Skill combing [email protected] intelligent instrument teaching aids based on 51 series single chip microcomputer

Use keil5 software to simulate and debug gd32f305 from 0
随机推荐
The precision problem of depth texture in unity shader - stepping pit - BRP pipeline (there is no solution, it is recommended to replace URP)
【Proteus仿真】Arduino UNO LED模拟交通灯
Deep dive kotlin synergy (18): hot and cold data flow
Pytorch Notebook. Nn. Batchnorm1d
Turn to cartoon learning notes
[rust weekly database] num bigint - large integer
Dow Jones Industrial Average
scratch绘制正方形 电子学会图形化编程scratch等级考试二级真题和答案解析2022年6月
断路器HystrixCircuitBreaker
Gd32 RT thread DAC driver function
What is erdma as illustrated by Coptic cartoon?
软件测试工程师面试基础题(应届生和测试小菜必备)最基础的面试题
Using LVM to resize partitions
sublist3r报错解决
When does the database need to use the index [Hangzhou multi surveyors] [Hangzhou multi surveyors _ Wang Sir]
LVGL 8.2 Simple Colorwheel
LVGL 8.2 Simple Drop down list
LVGL8.2 Simple Checkboxes
程序员需知的 59 个网站
ArrayList and sequence table