B4J Question Putting HugeImageView Inside a ScrollPane

xulihang

Well-Known Member
Licensed User
Longtime User
I am trying to put HugeImageView inside a ScrollPane, to make it scrollable with the scroll bars and in a top-left position.

I rewrite the part of scrolling and zooming by using ScrollPane and the part checking visible rect in the view port.

The image loading is done using OpenCV to save memory.

I am having two problems:

1. When zooming, the thumbnail and the tiles ImageView will appear alternatively.
2. If I zoom too much, the view becomes blank.


Any ideas how to solve the problems?



OpenCV is required to build the project: https://github.com/xulihang/OpenCV-B4J/releases/tag/library
Test image: https://upload.wikimedia.org/wikipedia/commons/8/8f/Whole_world_-_land_and_oceans_12000.jpg
 

Attachments

  • ZoomTest.zip
    15 KB · Views: 21
Solution
The problem is fixed.

1. The size of the panel of the tiles is wrong when the display scale is lower than 1.
2. When zooming, I set the size of the inner node size of the scroll pane first and then move the the cursor's position, causing reloading of the tiles.

xulihang

Well-Known Member
Licensed User
Longtime User
The problem is fixed.

1. The size of the panel of the tiles is wrong when the display scale is lower than 1.
2. When zooming, I set the size of the inner node size of the scroll pane first and then move the the cursor's position, causing reloading of the tiles.
 

Attachments

  • HugeImageViewInScrollPane.zip
    15.8 KB · Views: 8
Upvote 0
Solution
Top