I have a very large hi-Res card that I want to use in the application (the image size is about 80 mb).
I would like to know the following:
- How can I upload this image in the best way? I know that loading the image will take about a few seconds (this is normal), but I would like to notify the user about the progress. I would like to use a specific mode and show this as a
JProgressBar to the user. This should reflect the number of bytes downloaded or something like that. Is there a way to load images that can provide this functionality (e.g. ImageIO.read() )? - Since the map has a very high resolution, I would suggest that the user scroll to zoom in and out. How can I do this in the best way? I know that for scaling
BufferedImage standard way will take a very long time for such a large file. Is there an effective way to do this?
Thanks for your input!
Yours faithfully,
Hector van den Boorn
ps The image will be drawn on JPanel canvas.
Hi Andrew, Thank you so much for your help; everything works fine and loads quickly. Without your experience and explanation, I would still work on this so that you deserve a reward and a square.
I did the following: using imagemagick, I created several images of different resolutions and at the beginning of execution I downloaded only the smallest res. form. The rest are loaded into separate threads, so the execution does not stop. Using the information you provide, I then use the appropriate images when scaling or exiting. I am a little skeptical about using tiles because I need to draw my own images on top of the map, and I could not find the paint function in the external jar that you told me, so I ended up using something simple; when zooming or panning the zooming mode is set to fast, and when you are not zooming or panning, the zooming scale is set to anti-aliasing for images perfect for the pixel (as you expected), but it turns out to be fast enough, I need tiles (although I see that with even larger images this would be necessary, and I understand the information you gave me).
So thanks again and everything works fine :)
Hector van den boorn
source share