[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 to adjust the numerical to change objects.

ImageSlider Properties.

Identifier:
- ID: Unique number that identifies the object.
- Name: User-definable name for the object. It can be used with 86HMI API.
Content:
- Image: Bar Background: ImageSlider background.
- Image: Bar Foreground: ImageSlider foreground, for value display.
- Image: Thumb: ImageSlider Thumb image. For a description of the image source, see Image File Resource.
- Value: Default ImageSlider value.
- MaxValue: Maximum value can be positive or negative but must not be less than the minimum value.
- MinValue: Minimum value can be positive or negative but must not be bigger than the maximum value.
Geometry:
- X: Object X coordinate.
- Y: Object Y coordinate.
- Width: Object width. It cannot be adjusted by default.
- Height: Object height. It cannot be adjusted by default.
Options:
- Type: Slider type, Horizontal or Vertical.
- Enable: Select the default state of the object, enable or disable.
- Order: Object order. It can adjust the object order by up/down, which can be viewed on the Object List.
注意:
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.
Additional Information:
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.
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.

API Functions
setImageSliderValue()
描述
Set ImageSlider value.
語法
void setImageSliderValue(lv_obj_t* id, int value);
void setImageSliderValue(char* name, int value);
參數
[in] id
Object ID.[in] name
Object Name.[in] value
Set ImageSlider value.
Return
無
範例
#include "myhmi.h" void setup() { Hmi.begin(); Hmi.setImageSliderValue(p1isl1, 100); } void loop() { // ... }
getImageSliderValue()
描述
Get ImageSlider value.
語法
int getImageSliderValue(lv_obj_t* id);
int getImageSliderValue(char* name);
參數
[in] id
Object ID.[in] name
Object Name.
Return
ImageSlider value.
範例
#include "myhmi.h" void setup() { Serial.begin(115200); while (!Serial); Hmi.begin(); Hmi.setImageSliderValue(p1isl1, 100); Serial.print("p1isl1 value: "); Serial.println(Hmi.getImageSliderValue(p1isl1)); } void loop() { // ... }
imageSliderDragging()
The following Event Functions are written between BEGIN_HMI_EVENT_PROC
以及 END_HMI_EVENT_PROC
.
描述
Determine ImageSlider is dragging.
語法
bool imageSliderDragging(lv_obj_t* id);
bool imageSliderDragging(char* name);
參數
[in] id
Object ID.[in] name
Object Name.
Return
Bool. Determine ImageSlider is dragging.
範例
#include "myhmi.h" void setup() { Hmi.begin(); // ... } void loop() { BEGIN_HMI_EVENT_PROC { if (Hmi.imageSliderDragging(p1isl1)) { // do something. } } END_HMI_EVENT_PROC }
imageSliderDropped()
The following Event Functions are written between BEGIN_HMI_EVENT_PROC
以及 END_HMI_EVENT_PROC
.
描述
Determine ImageSlider is dropped.
語法
bool imageSliderDropped(lv_obj_t* id);
bool imageSliderDropped(char* name);
參數
[in] id
Object ID.[in] name
Object Name.
Return
Bool. Determine ImageSlider is dropped.
範例
#include "myhmi.h" void setup() { Hmi.begin(); // ... } void loop() { BEGIN_HMI_EVENT_PROC { if (Hmi.imageSliderDropped(p1isl1)) { // do something. } } END_HMI_EVENT_PROC }
Please see the 86HMI 編輯器使用手冊 for more instructions on 86HMI widgets and API usage.