当前位置: 首页 > wzjs >正文

网站开发 项目规划 怎么写广告销售如何寻找客户

网站开发 项目规划 怎么写,广告销售如何寻找客户,做网站空间备案的职业,青岛外贸假发网站建设一、Animation Image(Animimg)控件详解 1. 概述 功能:Animimg 是 LVGL 中用于显示动画图像的控件。特点:支持从多个静态图像创建动画效果。 2. 创建和初始化 创建方法:lv_obj_t * lv_animimg_create(lv_obj_t * pa…

一、Animation Image(Animimg)控件详解

1. 概述

  • 功能Animimg 是 LVGL 中用于显示动画图像的控件。
  • 特点:支持从多个静态图像创建动画效果。

2. 创建和初始化

  • 创建方法
    lv_obj_t * lv_animimg_create(lv_obj_t * parent);
    
  • 示例
    lv_obj_t * animimg = lv_animimg_create(parent);
    

3. 设置属性

  • 设置源图像数组

    void lv_animimg_set_src(lv_obj_t * obj, const lv_img_dsc_t ** src);
    
    • 参数
      • objAnimimg 对象。
      • src:包含图像描述符的数组。
  • 设置帧间隔时间

    void lv_animimg_set_duration(lv_obj_t * obj, uint32_t duration);
    
    • 参数
      • objAnimimg 对象。
      • duration:每帧之间的间隔时间(毫秒)。
  • 设置播放次数

    void lv_animimg_set_repeat_count(lv_obj_t * obj, uint32_t count);
    
    • 参数
      • objAnimimg 对象。
      • count:动画重复播放的次数,0 表示无限循环。
  • 开始/停止动画

    void lv_animimg_start(lv_obj_t * obj);
    void lv_animimg_stop(lv_obj_t * obj);
    
    • 参数
      • objAnimimg 对象。

4. 示例代码

// 定义图像描述符数组
static const lv_img_dsc_t * img_array[] = {&img_frame_1,&img_frame_2,&img_frame_3,NULL  // 数组末尾必须为 NULL
};// 创建 Animimg 控件
lv_obj_t * animimg = lv_animimg_create(lv_scr_act());// 设置图像源
lv_animimg_set_src(animimg, img_array);// 设置帧间隔时间
lv_animimg_set_duration(animimg, 100);  // 每帧间隔 100 毫秒// 设置播放次数
lv_animimg_set_repeat_count(animimg, 0);  // 无限循环// 开始动画
lv_animimg_start(animimg);

5. 注意事项

  • 图像格式:确保所有图像描述符都已正确定义并加载到内存中。
  • 性能考虑:大量高分辨率图像可能会影响系统性能,建议优化图像资源。

二、效果展示

在这里插入图片描述

三、源码分享

ui.h


typedef struct
{lv_obj_t *screen;bool screen_del;lv_obj_t *screen_animimg;lv_obj_t *screen_image3D;lv_obj_t *screen_btnStart;lv_obj_t *screen_btnStart_label;lv_obj_t *screen_btnRotation;lv_obj_t *screen_btnRotation_label;
}lv_ui;

ui.c

#include "lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"
#include "widgets_init.h"
#include "custom.h"void setup_scr_screen(lv_ui *ui)
{//Write codes screenui->screen = lv_obj_create(NULL);lv_obj_set_size(ui->screen, 800, 480);lv_obj_set_scrollbar_mode(ui->screen, LV_SCROLLBAR_MODE_OFF);//Write style for screen, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.lv_obj_set_style_bg_opa(ui->screen, 255, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_bg_color(ui->screen, lv_color_hex(0x13e6d2), LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_bg_grad_dir(ui->screen, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);//Write codes screen_animimgui->screen_animimg = lv_animimg_create(ui->screen);lv_animimg_set_src(ui->screen_animimg, (const void **) screen_animimg_imgs, 20, false);lv_animimg_set_duration(ui->screen_animimg, 30*20);lv_animimg_set_repeat_count(ui->screen_animimg, LV_ANIM_REPEAT_INFINITE);lv_img_set_src(ui->screen_animimg, screen_animimg_imgs[0]);lv_obj_set_pos(ui->screen_animimg, 27, 14);lv_obj_set_size(ui->screen_animimg, 354, 325);//Write codes screen_image3Dui->screen_image3D = lv_animimg_create(ui->screen);lv_animimg_set_src(ui->screen_image3D, (const void **) screen_image3D_imgs, 22, false);lv_animimg_set_duration(ui->screen_image3D, 200*22);lv_animimg_set_repeat_count(ui->screen_image3D, LV_ANIM_REPEAT_INFINITE);lv_img_set_src(ui->screen_image3D, screen_image3D_imgs[0]);lv_obj_set_pos(ui->screen_image3D, 416, 14);lv_obj_set_size(ui->screen_image3D, 322, 317);//Write codes screen_btnStartui->screen_btnStart = lv_btn_create(ui->screen);ui->screen_btnStart_label = lv_label_create(ui->screen_btnStart);lv_label_set_text(ui->screen_btnStart_label, "Start");lv_label_set_long_mode(ui->screen_btnStart_label, LV_LABEL_LONG_WRAP);lv_obj_align(ui->screen_btnStart_label, LV_ALIGN_CENTER, 0, 0);lv_obj_set_style_pad_all(ui->screen_btnStart, 0, LV_STATE_DEFAULT);lv_obj_set_width(ui->screen_btnStart_label, LV_PCT(100));lv_obj_set_pos(ui->screen_btnStart, 123, 392);lv_obj_set_size(ui->screen_btnStart, 100, 50);//Write style for screen_btnStart, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.lv_obj_set_style_bg_opa(ui->screen_btnStart, 255, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_bg_color(ui->screen_btnStart, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_bg_grad_dir(ui->screen_btnStart, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_border_width(ui->screen_btnStart, 0, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_radius(ui->screen_btnStart, 5, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_shadow_width(ui->screen_btnStart, 0, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_text_color(ui->screen_btnStart, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_text_font(ui->screen_btnStart, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_text_opa(ui->screen_btnStart, 255, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_text_align(ui->screen_btnStart, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);//Write codes screen_btnRotationui->screen_btnRotation = lv_btn_create(ui->screen);ui->screen_btnRotation_label = lv_label_create(ui->screen_btnRotation);lv_label_set_text(ui->screen_btnRotation_label, "Rotation\n");lv_label_set_long_mode(ui->screen_btnRotation_label, LV_LABEL_LONG_WRAP);lv_obj_align(ui->screen_btnRotation_label, LV_ALIGN_CENTER, 0, 0);lv_obj_set_style_pad_all(ui->screen_btnRotation, 0, LV_STATE_DEFAULT);lv_obj_set_width(ui->screen_btnRotation_label, LV_PCT(100));lv_obj_set_pos(ui->screen_btnRotation, 550, 392);lv_obj_set_size(ui->screen_btnRotation, 100, 50);//Write style for screen_btnRotation, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.lv_obj_set_style_bg_opa(ui->screen_btnRotation, 255, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_bg_color(ui->screen_btnRotation, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_bg_grad_dir(ui->screen_btnRotation, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_border_width(ui->screen_btnRotation, 0, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_radius(ui->screen_btnRotation, 5, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_shadow_width(ui->screen_btnRotation, 0, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_text_color(ui->screen_btnRotation, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_text_font(ui->screen_btnRotation, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_text_opa(ui->screen_btnRotation, 255, LV_PART_MAIN|LV_STATE_DEFAULT);lv_obj_set_style_text_align(ui->screen_btnRotation, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);//The custom code of screen.//Update current screen layout.lv_obj_update_layout(ui->screen);//Init events for screen.events_init_screen(ui);
}

觉得有用点个赞呗!

http://www.dtcms.com/wzjs/25975.html

相关文章:

  • 网站建设需要会什么软件如何自己建网站
  • 网站建设公司画册长沙网红打卡地
  • 做调查问卷网站市场营销主要学什么
  • 外贸网站收到询盘百度关键词优化软件网站
  • 企业网站建设管理视频站长之家网站模板
  • c 网站开发案例源码百度广告联盟平台的使用知识
  • 做网站搞笑口号怎样做市场营销策划
  • 微信小程序开发文档下载海城seo网站排名优化推广
  • 哈尔滨网站推广公司新闻投稿
  • 临河 网站建设网站seo视频
  • 微信首页制作代码宁宁网seo
  • 国外精彩网站网页制作公司排名
  • vs2015做简单网站上海关键词优化外包
  • 长沙市网站制作哪家好北京优化seo排名优化
  • 哪里有门户网站开发公司如何获取永久免费域名
  • 那些网站是做俄罗斯鞋子长春网络科技公司排名
  • 个人网页的内容长沙优化网站推广
  • 合肥 做网站的公司网站制作
  • 那个网站开发三味注册城乡规划师
  • 网站优化方式站长分析工具
  • 好的网站建设平台网站怎么快速收录
  • 儒枫网网站建设百度手机助手下载
  • 整形美容医院手机网站wap模板农村电商平台
  • 免费详情页模板网站网站安全检测平台
  • 做镜像网站利润广东疫情最新通报
  • 购物网站的建设东莞seo优化排名
  • 做网站主要学什么软件百度安装下载
  • 微信分享接口网站开发 php中国十大互联网公司
  • 合肥做双语外贸网站打开百度官网
  • 网站制作合作网络优化大师下载