I
iamfractal
Hi, folks!
I have a BufferedImage onto which I'm drawing simple lines and
polygons, but I want to allow the user to magnify the final graphic
and allow, "Zooming-in," on a choice line or polygon.
To cater for this magnification, I'd like the graphic to be placed in
a JScrollPane, so that, as the user zooms, the graphic can be dragged
about.
My problem is that, as I magnify, I must double the size of the
BufferedImage each time and draw the lines and polygons twice as big;
but after a couple of magnifications, the BufferedImage throws an
OutOfMemory exception.
Is there a simple way to create allocate memory for only a particaly
part of a BufferedImage, rather than for the whole thing?
(I want neither to use the Image.getScaledInstance() to zoom-in
(because of pixellation), nor to increase heap-size to allow for
monster BufferedImages.)
Thanks,
..ed
www.EdmundKirwan.com
I have a BufferedImage onto which I'm drawing simple lines and
polygons, but I want to allow the user to magnify the final graphic
and allow, "Zooming-in," on a choice line or polygon.
To cater for this magnification, I'd like the graphic to be placed in
a JScrollPane, so that, as the user zooms, the graphic can be dragged
about.
My problem is that, as I magnify, I must double the size of the
BufferedImage each time and draw the lines and polygons twice as big;
but after a couple of magnifications, the BufferedImage throws an
OutOfMemory exception.
Is there a simple way to create allocate memory for only a particaly
part of a BufferedImage, rather than for the whole thing?
(I want neither to use the Image.getScaledInstance() to zoom-in
(because of pixellation), nor to increase heap-size to allow for
monster BufferedImages.)
Thanks,
..ed
www.EdmundKirwan.com