J
jonck
Hi,
In my app people can load a picture, which I then show in a scaled down
version. To do the scaling I follow the sample code as shown here:
http://javaalmanac.com/egs/java.awt.image/CreateTxImage.html
All this works fine, though sometimes if a user loads in a very large
pictuer I get an OutOfMemory error. Now ideally what I would like to do
is test before the picture is loaded whether there is enough memory
available to do the operation. In order to do that I would need to get
an idea of how much memory will be needed to do the scaling.
Does anyone know what (roughly) the proportion is of memory used to the
size and depth of the picture?
Thanks, Jonck
In my app people can load a picture, which I then show in a scaled down
version. To do the scaling I follow the sample code as shown here:
http://javaalmanac.com/egs/java.awt.image/CreateTxImage.html
All this works fine, though sometimes if a user loads in a very large
pictuer I get an OutOfMemory error. Now ideally what I would like to do
is test before the picture is loaded whether there is enough memory
available to do the operation. In order to do that I would need to get
an idea of how much memory will be needed to do the scaling.
Does anyone know what (roughly) the proportion is of memory used to the
size and depth of the picture?
Thanks, Jonck