[matlab2020b] how to get scroll position in panel object.

4 次查看(过去 30 天)
I don't know how to get scroll cordination.
1. GUI screenshot and setting
  • UIFigure size: 0,0,1400,488
  • UITabGroup size: 0,0,1400,488
  • UIPanel size: 15,192,1267,221 (but scrollable depend on data)
I should put the blue button on the grid(it is uiimage). in the correct position.
2. Problem
when I scroll it, button is located in wrong position because the coordinate system has changed. Currently, the offset between the click coordinates of UIFigure and the position coordinates of UIImage is determined the position of the blue button. However, when scrolling occurs within the UIPanel, the UIFigure coordinates do not change. Therefore, the background (UIPanel) moves, but the click coordinates (UIFIGURE) continue to be the same and occur cordinate mismatch.
3. Solution
To solve this problem, I think we can continue to correct the offset by reflecting the scroll coordinates. But I can't figure out how much I scrolled in the matlab. So I ask a question. And this is just my idea, and if you have a better idea, please let me know.

回答(1 个)

Abhishek Chakram
Abhishek Chakram 2023-12-19
编辑:Abhishek Chakram 2023-12-19
Hi 상범 ,
It appears to me that you want to get the scroll position in a ”uipanel”. You can refer to the following MATLAB Answer for the same: https://www.mathworks.com/matlabcentral/answers/798802-acess-scroll-bar-location
Best Regards,
Abhishek Chakram

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by