Image as a background of a uicontrol or uipanel?
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Vadim Kachan
le 3 Juin 2019
Commenté : Walter Roberson
le 4 Juin 2019
Hi, I am trying to make a UI that will work with my script. The goal is to use an image as a background and place buttons ontop of the image so that I can route to different parts of my script from there. Similar to a website design in terms of navigation. I am having a hard time getting my image to show up. any ideas on how i can do that in a uicontrol or uipanel? I have not found any good tutorials or discussions that show this.
2 commentaires
Geoff Hayes
le 3 Juin 2019
Vadim - are you using GUIDE, App Designer, or are you programmatically creating your GUI?
Réponse acceptée
Walter Roberson
le 3 Juin 2019
You cannot get an image to show up in uipanel, except by grabbing its JavaFrame and manipulating that.
You cannot get an image to show up on uicontrol, except for styles pushbutton, togglebutton, radiobutton, or checkbox, in which case the image would be displayed where the button would normally appear.
What you need to do is put up an axes, and then carefully position your ui controls over the axes. There will not be any connection between the axes and the controls: you cannot, for example, configure the controls to be relative to the axes position, or in data units: you can just have the coincidence of them happening to be in the same portion of the figure.
2 commentaires
Walter Roberson
le 4 Juin 2019
In r2014a and earlier, uicontrol are on top of everything else except perhaps annotations. In R2014b and later then later objects should be on top of uicontrol but the z coordinates of uicontrol are not really well defined and are probably treated as 0.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!