Interactive knob style slider
Renewed version which is using class definition updated.
https://www.mathworks.com/matlabcentral/fileexchange/66701-interactive-knob-style-slider-class-object-type
* This function is tested under MATLAB 2015, 2016, 2017.
This function was designed for make knob style slider on MATLAB GUI application. User can use their own image for slider. To use this function, axes object is required.
How to use.
Syntax
knobslider(axeshandle, GUIhandle, 'Property',Value)
Description
Examples of using all variables are provided in GUI_slider.m and figureslider.m. The following explains the use of variables.
axeshandle is handle name of axes object you want to use as a slide.
GUI handle is input variable for GUIDE handle struct variable. If you want to use figure object only without GUIDE, just insert 0 or other dummy value.
knobslider have 6 properties.
1. value, 2. knobratio, 3. callback, 4. direction, 5.slotimg, 6. knobimg
1. value
'value' is a property that defines the position of the knob in the slider. The default value is 0. The 'value' is determined between 0 and 1. You can use this property to initialize the knob position or set the knob position to the desired position. An example of initializing or setting a specific position of the knob position is provided in GUI_slider.m. See Opening GUI Functions and Button Callback Functions in Example Code.
2. knobratio
The knob ratio defines the aspect ratio of the knob image. The ratio is determined by 'sliderlength dimension / slider width dimension'. The example is provided in GUI_slider.m.
3. callback
A custom function is required for the input. You can define the slider's response when you click the knob or move the knob. The required variables of the callback function are value and handle. For example, you can write as follows.
Function callback_example(value, handles)
Contents what you want
End
The value is determined by the knob position. (0 -1) handle is the handle input used in the initialization step.
4. direction
This property determines the orientation of the slider. You can use 'H' for the horizontal slider and 'V' for the vertical slider. The default value is 'H'.
5. slotimg, knobimg
You can use these properties to customize the slider using a custom image. These properties must use the file name string. Only PNG images are allowed. The default values are 'slot.png' and 'knob.png'.
Cita come
Seonghee Cho (2025). Interactive knob style slider (https://it.mathworks.com/matlabcentral/fileexchange/66631-interactive-knob-style-slider), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Compatibilità della piattaforma
Windows macOS LinuxCategorie
- Image Processing and Computer Vision > Image Processing Toolbox > Display and Exploration > Build Interactive Tools >
Tag
Riconoscimenti
Ispirato: Volume slice browser. (3D slice viewer), Interactive knob style slider Class-Object type
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
| Versione | Pubblicato | Note della release | |
|---|---|---|---|
| 1.0.0.0 | Renewed version which is using class definition updated.
|
