Image as a background of a uicontrol or uipanel?

10 vues (au cours des 30 derniers jours)
Vadim Kachan
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
Geoff Hayes le 3 Juin 2019
Vadim - are you using GUIDE, App Designer, or are you programmatically creating your GUI?
Vadim Kachan
Vadim Kachan le 3 Juin 2019
programmatically creating the gui

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
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
Vadim Kachan
Vadim Kachan le 3 Juin 2019
Roger, that verifies my findings thus far - uipanel/uicontrol cant handle images as backgrounds. That is a bit odd.
I decided to go with the second option - using a button push button, except now i am having difficulties with getting the right order of things. The image button is in the very front where i want it in the back.
coding is quite the journey. haha
Walter Roberson
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.

Connectez-vous pour commenter.

Plus de réponses (0)

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!

Translated by