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

5 views (last 30 days)
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.

Answers (1)

Abhishek Chakram
Abhishek Chakram on 19 Dec 2023
Edited: Abhishek Chakram on 19 Dec 2023
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

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!