Figure zoom-in by mouse scroll is disabled after ROI is drawn

3 ビュー (過去 30 日間)
Xingwang Yong
Xingwang Yong 2022 年 9 月 30 日
回答済み: Rahul 2023 年 2 月 27 日
figure;imshow(imread('pout.tif'));
Normally, I can use mouse scroll to zoom-in and zoom-out. But, if I draw ROI,
imrect();
The zoom-in by mouse scroll is disabled. I have to click the "+" icon on the top right to enable zoom in.
Although the newer drawrectangle() is not affected by this, I have to use old way imrect() because a lot of dependency. Is there any way to avoid this?

回答 (1 件)

Rahul
Rahul 2023 年 2 月 27 日
An "imrect" object encapsulates an interactive rectangle over an image. You can adjust the size and position of the rectangle by using the mouse. The rectangle also has a context menu that controls aspects of its appearance and behavior.
However, starting in R2018b, a new set of ROI objects replaces the existing set of ROI objects. The new objects provide more functional capabilities, such as face color transparency. The new classes also support events that you can use to respond to changes in your ROI such as moving or being clicked. The mouse functionality is disabled as soon as the "imrect" object is created. Hence, the mouse properties such as zooming in/out is not allowed. As you can alter the position as well as height-width of the rectangle in "imrect", clicking option is available. Hence, you can use interactive pane given in the top-right corner but scolling operation is disabled. This issue is alleviated in "drawrectangle".

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by