Im making a swing desktop application. It draws layered vector graphics and the interface uses a scrollbar and has the ability to zoom in. There are about 5 layers of vector graphics and one layer in particualy is very expensive to draw. The layers may require to be repainted from time to time (simple animation).
The situation right now is as follows:
- A buffered image is created
- Every layers gets drawn on the image
- the buffered image is displayed on the screen using a panel that has the same size so that a scrollbar can be used.
Im running into performance issues when i zoom in. The zooming can make the buffered image really big. An image can peak at 60000x60 when the scale is at 16x. Offcourse this takes up a lot of memmory and i want to redesign this.
I really dont know where to start though, i feel like im reinventing the wheel. My knowledge of java2d is also very limited. I really want to improve this by maybe using a library, i know there must be something that has the functionality i want. Any libraries that come to mind?