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

4 visualizaciones (últimos 30 días)
상범 하
상범 하 el 14 de En. de 2022
Editada: Abhishek Chakram el 19 de Dic. de 2023
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.

Respuestas (1)

Abhishek Chakram
Abhishek Chakram el 19 de Dic. de 2023
Editada: Abhishek Chakram el 19 de Dic. de 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

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by