0

I am getting IOException when I try to create image in lwuit. the following is the code : InputStream is = img.getResourceAsStream(); Image img = Image.createImage(is);

the actual size of images are 1 mb and above. Where I am able to create images of 100 or 200 kb in size with the same code.

Thanks.

shriniket
  • 55
  • 1
  • 7
  • Are the images 1 MB, **as compressed files?** A 1 MB compressed image will be quite a lot bigger uncompressed, which is what the mobile device needs to actually be displayed. – Nate Feb 22 '13 at 08:12
  • No! You may say that images are captured and directly sent to the j2me device where application opens that image. – shriniket Feb 22 '13 at 11:29

1 Answers1

0

Yes the size of your images is the reason

try to resize your images using this site http://www.picresize.com/

PHPFan
  • 756
  • 3
  • 12
  • 46
  • Yes! thanks! but could you please tell me if I can do it through coding in midlet. I have tried resizing images that i receive but it needs an image to be created first of all and then manipulate its rgb data. Where I am getting IOException while creating image at first. Please help me resolve this issue. – shriniket Feb 25 '13 at 05:42
  • Here I am using Lwuit createImage(Path) method and passing image path as an argument. – shriniket Feb 25 '13 at 05:44
  • Please write your full code and give me an example of image you want to create by link or upload it . That makes me faster and better help you . – PHPFan Feb 25 '13 at 11:42