{"id":15718,"date":"2024-12-02T07:53:06","date_gmt":"2024-12-02T07:53:06","guid":{"rendered":"https:\/\/www.qec.tw\/?p=15718"},"modified":"2024-12-02T07:53:09","modified_gmt":"2024-12-02T07:53:09","slug":"imageslider","status":"publish","type":"post","link":"https:\/\/www.qec.tw\/zh\/86duino\/86hmi\/imageslider\/","title":{"rendered":"86HMI::ImageSlider"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">[Control widgets]<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Object Functions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Image Slider object. It can control the movement of the image slider, manage the change of events and can be used to adjust the numerical to change objects.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"606\" height=\"325\" src=\"https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-11.png\" alt=\"ImageSlider-1\" class=\"wp-image-15719\" srcset=\"https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-11.png 606w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-11-300x161.png 300w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-11-18x10.png 18w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-11-600x322.png 600w\" sizes=\"(max-width: 606px) 100vw, 606px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">ImageSlider Properties.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"236\" height=\"434\" src=\"https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-12.png\" alt=\"ImageSlider-2\" class=\"wp-image-15720\" srcset=\"https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-12.png 236w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-12-163x300.png 163w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-12-7x12.png 7w\" sizes=\"(max-width: 236px) 100vw, 236px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Identifier:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ID: Unique number that identifies the object.<\/li>\n\n\n\n<li>Name: User-definable name for the object. It can be used with 86HMI API.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Content:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Image: Bar Background: ImageSlider background.<\/li>\n\n\n\n<li>Image: Bar Foreground: ImageSlider foreground, for value display.<\/li>\n\n\n\n<li>Image: Thumb: ImageSlider Thumb image. For a description of the image source, see Image File Resource.<\/li>\n\n\n\n<li>Value: Default ImageSlider value.<\/li>\n\n\n\n<li>MaxValue: Maximum value can be positive or negative but must not be less than the minimum value.<\/li>\n\n\n\n<li>MinValue: Minimum value can be positive or negative but must not be bigger than the maximum value.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Geometry:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>X: Object X coordinate.<\/li>\n\n\n\n<li>Y: Object Y coordinate.<\/li>\n\n\n\n<li>Width: Object width. It cannot be adjusted by default.<\/li>\n\n\n\n<li>Height: Object height. It cannot be adjusted by default.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Options:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Type: Slider type, Horizontal or Vertical.<\/li>\n\n\n\n<li>Enable: Select the default state of the object, enable or disable.<\/li>\n\n\n\n<li>Order: Object order. It can adjust the object order by up\/down, which can be viewed on the Object List.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong><br>If you want the customized image slider switch to be presented horizontally or vertically, you must create and add the image file source both horizontally and vertically. When a user wants to use horizontal, select the horizontal image file; if vertical, select the vertical image file; 86HMI Editor will not turn to it automatically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Additional Information:<\/strong><br>When editing Image: Bar Foreground horizontally, show that its left and right widths should be aligned with the left and right sides of the canvas of the image editing software, or else the left and right sides will be left blank when imported for use.Image: Bar Background can be a little bit longer than Bar Foreground and will match with it automatically when imported, and when vertically, it is to grab the top and bottom borders of Bar Foreground as the start and end positions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When it is vertical, it will grab the top and bottom border of Bar Foreground to be the start and end position. If you need scale, then you need to add scale marking when editing.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"442\" src=\"https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-13-1024x442.png\" alt=\"ImageSlider-3\" class=\"wp-image-15721\" srcset=\"https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-13-1024x442.png 1024w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-13-300x129.png 300w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-13-768x331.png 768w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-13-18x8.png 18w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-13-600x259.png 600w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-13.png 1090w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">API Functions<\/h2>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">setImageSliderValue()<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Description<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Set ImageSlider value.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>void setImageSliderValue(lv_obj_t* id, int value);<br>void setImageSliderValue(char* name, int value);<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>[in] id<\/code><br>Object ID.<\/li>\n\n\n\n<li><code>[in] name<\/code><br>Object Name.<\/li>\n\n\n\n<li><code>[in] value<\/code><br>Set ImageSlider value.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Return<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">None.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &quot;myhmi.h&quot;\n\nvoid setup() {\n  Hmi.begin();\n  Hmi.setImageSliderValue(p1isl1, 100);\n}\n\nvoid loop() {\n  \/\/ ...\n}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">getImageSliderValue()<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Description<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Get ImageSlider value.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>int getImageSliderValue(lv_obj_t* id);<br>int getImageSliderValue(char* name);<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>[in] id<\/code><br>Object ID.<\/li>\n\n\n\n<li><code>[in] name<\/code><br>Object Name.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Return<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">ImageSlider value.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &quot;myhmi.h&quot;\n\nvoid setup() {\n  Serial.begin(115200);\n  while (!Serial);\n  \n  Hmi.begin();\n  Hmi.setImageSliderValue(p1isl1, 100);\n  Serial.print(&quot;p1isl1 value: &quot;);\n  Serial.println(Hmi.getImageSliderValue(p1isl1));\n}\n\nvoid loop() {\n  \/\/ ...\n}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">imageSliderDragging()<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The following Event Functions are written between\u00a0<code>BEGIN_HMI_EVENT_PROC<\/code>\u00a0and\u00a0<code>END_HMI_EVENT_PROC<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Description<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Determine ImageSlider is dragging.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>bool imageSliderDragging(lv_obj_t* id);<br>bool imageSliderDragging(char* name);<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>[in] id<\/code><br>Object ID.<\/li>\n\n\n\n<li><code>[in] name<\/code><br>Object Name.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Return<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Bool. Determine ImageSlider is dragging.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &quot;myhmi.h&quot;\n\nvoid setup() { \n  Hmi.begin();\n  \/\/ ...\n}\n\nvoid loop() {\n  BEGIN_HMI_EVENT_PROC\n  {\n    if (Hmi.imageSliderDragging(p1isl1))\n    {\n      \/\/ do something.\n    }\n  }\n  END_HMI_EVENT_PROC\n}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">imageSliderDropped()<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The following Event Functions are written between\u00a0<code>BEGIN_HMI_EVENT_PROC<\/code>\u00a0and\u00a0<code>END_HMI_EVENT_PROC<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Description<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Determine ImageSlider is dropped.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>bool imageSliderDropped(lv_obj_t* id);<br>bool imageSliderDropped(char* name);<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>[in] id<\/code><br>Object ID.<\/li>\n\n\n\n<li><code>[in] name<\/code><br>Object Name.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Return<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Bool. Determine ImageSlider is dropped.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &quot;myhmi.h&quot;\n\nvoid setup() { \n  Hmi.begin();\n  \/\/ ...\n}\n\nvoid loop() {\n  BEGIN_HMI_EVENT_PROC\n  {\n    if (Hmi.imageSliderDropped(p1isl1))\n    {\n      \/\/ do something.\n    }\n  }\n  END_HMI_EVENT_PROC\n}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Please see the\u00a0<a href=\"https:\/\/www.qec.tw\/86duino\/86hmi\/\">86HMI Editor User Manual<\/a>\u00a0for more instructions on 86HMI widgets and API usage.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Control widgets] Object Functions Image Slider object. It can control the movement of the image slider, manage the change of events and can be used [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":15723,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[285],"tags":[162],"class_list":["post-15718","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-86hmi","tag-86duino"],"_links":{"self":[{"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/posts\/15718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/comments?post=15718"}],"version-history":[{"count":0,"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/posts\/15718\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/media\/15723"}],"wp:attachment":[{"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/media?parent=15718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/categories?post=15718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/tags?post=15718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}