App Designer - Button group

22 次查看(过去 30 天)
Venkata Khambhammettu
Hello, I am working on a GUI using two buttons where the enhancement operations perfromed on an image can be changed. Once I select the required operation; I have an another drop down gives options in relation to the first selection. My questions is
  • It looks like by default the first button is always pressed. So when am running if condition to check whether the first button is selected or not; some how the code within the if not executing; it is only executing when the value is changed (means when option changed from one radio button to the other and vice versa)
How can i access the initial value or default value of radio button selection.
Thanks.

回答(2 个)

Cris LaPierre
Cris LaPierre 2020-9-17
  8 个评论
Venkata Khambhammettu
I see what you are saying now. Linear stretching must be selected to even go into the if statement. In the modified code (attached above) ; I do have linear stretching selected and contrast is at Low. For reason, i dont understand; the processed image is not showing; unless I click on second method and then come back to the first.
Thanks.
Cris LaPierre
Cris LaPierre 2020-9-22
编辑:Cris LaPierre 2020-9-22
What is your trigger? Do you want the app to open with the linear stretching result already displayed? If so, place the following at the bottom of your startupFcn callback.
MethodButtonGroupSelectionChanged(app, app.MethodButtonGroup)

请先登录,再进行评论。


Mario Malic
Mario Malic 2020-9-22
编辑:Mario Malic 2020-9-22
  • Create property that takes Method and Contrast level values.
  • Create a callback for button group (method and image enhancement operation) - see this property (app.ImageEnhancementOperationButtonGroup.SelectedObject.Text)
  • Create a callback that sends contrast dropdown value to property.
  • Initialise starting values in startupFcn, for each component.
You read your image twice, save it in a property.

类别

Help CenterFile Exchange 中查找有关 Visual Exploration 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by