Problem in showing images
Hello Sir,
I tried to show all the images present in the phone through my application.It raised 'Out of Memory' exception. So, I tired to view at least 3 images at a time of size around 200 kb each. Still facing the same problem.How to fix this? Kindly help me out......
Re: Problem in showing images
What phone, and how big are the images (in pixels, not bytes)? Check the device specifications, and [url=http://wiki.forum.nokia.com/index.php/Memory_Usage_Images]this wiki article[/url].
Graham.
Re: Problem in showing images
Phone 3110c.
Pixels 1024 * 768
size around 56 kb to 100 kb files
Re: Problem in showing images
[QUOTE=varunmails;654613]Phone 3110c.
Pixels 1024 * 768
size around 56 kb to 100 kb files[/QUOTE]
Hi,
Welcome to the Forum Nokia developer boards,
Well,as you have written that the image size is 200 kb per image,and hence the total image size would be around 600 KB.Therefore we would like to ask that why you are taking so heavy images.Why do not you take size around 15-25 KB.
Another things is of interest is that how and where you are creating the image..I mean please check that you are not loading the same in a loop,
And where you are calling the repaint() I mean in the infinite run() or on the keypressed.I would recommend that cal the repaint on the key pressed if you are not paying a rich animation.
Please check that the jar and heap size limitation of the targeted device is
[QUOTE]Maximum Heap Size 2 MB
Maximum JAR Size 1 MB
[/QUOTE]
Please check the above points,and please provide more information about the issue if still not get solved.
Re: Problem in showing images
3110 Classic has 2Mb of heap.
An image 1024 x 768 pixels, assuming 16 bits per pixel, requires 1.5Mb. More than that if the bit-depth is greater. At 32 bits per pixel, each image needs 3Mb of heap to load. I don't know what bit-depth the device will use. But either way, you can see that you will not be able to load more than one image, and you might not be able to load even one.
Re: Problem in showing images
HI
Please use small image for mobile.dont use too large images
Re: Problem in showing images
I tried to show the images which are stored in my mobile.
The images are such large :(.
Ok,so i can't show it as a thumbnail rt..? Since, its too large
Re: Problem in showing images
The only way to display a thumbnail would be if you were to write your own JPEG decoder. Then you decompress the image one section at a time, and generate a thumbnail without running out of memory.
Otherwise, no, handling images of that size in Java is outside the capability of that device.
Graham.