- The mouse cursor does not update when you hover over the ROI. The cursor is always an arrow.
- The ROI does not change color when you hover over it.
- The ROI right-click menu (UIContextMenu) is not supported.
Using 'getrect' on the main design window - App Designer
2 次查看(过去 30 天)
显示 更早的评论
Hi
Below is my main design window. As you can see, within the blue box it is an Image Object, not an Axes Object. There is no axes objects used in this design.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/810739/image.png)
When I press the top button 'load your image', a single colour image will appear on the left as below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/810744/image.png)
What I would like to achieve:
At this stage I would like the mouse to change to a little cross automatically and ready to grab an area within this design window (not to open a new figure).
How to apply 'get rect' this this case and where to put the code?
At the moment, below is where and how I try to write the 'getrect'. Clearly something went wrong there which I don't fully understand. :(
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/810769/image.png)
Also, the image has its ImageClick Callback. But guess I never want to click on the image so guess this shouldn't apply?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/810749/image.png)
Can anyone please advise?
Many thanks.:)
0 个评论
回答(1 个)
Cris LaPierre
2021-12-29
The getrect and recommended drawrectangle function only work with axes objects. The workaround may be to add an axes, and then display the image using imshow (or other appropriate image display function) after loading it using imread.
Using ROIs in Apps Created with App Designer
You can use ROIs in apps created with App Designer, parenting an ROI in a UIAxes. You must explicitly specify the UIAxes when calling the ROI creation function, as an input argument or using the 'Parent' name/value pair. There are a few limitations when using ROIs in apps in this way:
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!