当前位置:网站首页>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
边栏推荐
- Machine learning interview preparation (I) KNN
- Pandora IOT development board learning (HAL Library) - Experiment 1 running lantern (RGB) experiment (learning notes)
- go-zero微服务实战系列(八、如何处理每秒上万次的下单请求)
- [deep learning] common methods for deep learning to detect small targets
- Memory escape analysis
- 苹果高管公然“开怼”:三星抄袭 iPhone,只加了个大屏
- 基于HAL库的LED驱动库
- Gd32 RT thread ota/bootloader driver function
- Google 辟谣放弃 TensorFlow,它还活着!
- Criu enables hot migration
猜你喜欢
【STL源码剖析】容器(待补充)
腾讯云数据库工程师能力认证重磅推出,各界共话人才培养难题
Unity Shader - 踩坑 - BRP 管线中的 depth texture 的精度问题(暂无解决方案,推荐换 URP)
The intelligent DNA molecular nano robot model is coming
[email protected] voice module +stm32+nfc"/>
Skill combing [email protected] voice module +stm32+nfc
煥發青春的戴爾和蘋果夾擊,兩大老牌PC企業極速衰敗
Viewing technological changes through Huawei Corps (V): smart Park
The two e-commerce bigwigs' lacy news screens represent the return of e-commerce to normal, which will be beneficial to the real economy
Qt之实现动效导航栏
When does the database need to use the index [Hangzhou multi surveyors] [Hangzhou multi surveyors _ Wang Sir]
随机推荐
Skill combing [email protected] control a dog's running on OLED
Viewing technological changes through Huawei Corps (V): smart Park
Overview of currency
Voir le changement technologique à travers la Légion Huawei (5): Smart Park
Pytorch notes torch nn. BatchNorm1d
19:00 p.m. tonight, knowledge empowerment phase 2 live broadcast - control panel interface design of openharmony smart home project
同事的接口文档我每次看着就头大,毛病多多。。。
[rust weekly database] num bigint - large integer
ArcGIS PRO + PS vectorized land use planning map
List介绍
LVGL 8.2 Checkboxes as radio buttons
05_Node js 文件管理模块 fs
Pycharm项目使用pyinstalle打包过程中问题及解决方案
Machine learning interview preparation (I) KNN
历史上的今天:微软收购 PowerPoint 开发商;SGI 和 MIPS 合并
OLAP数据库引擎如何选型?
智能DNA分子纳米机器人模型来了
再测云原生数据库性能:PolarDB依旧最强,TDSQL-C、GaussDB变化不大
时间复杂度与空间复杂度
The intelligent DNA molecular nano robot model is coming