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

조회 수: 4 (최근 30일)
상범 하
상범 하 2022년 1월 14일
편집: Abhishek Chakram 2023년 12월 19일
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에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by