Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Posts: 15
Registered: ‎06-11-2011
My Device: 9800
My Carrier: Rogers

Resizing images

[ Edited ]

Hi,

 

I am wondering if anyone knows how the PlayBook pictures app is creating thumbnails of images for such a smooth scrolling? 

 

My ap creates thumbnails of all images and I am trying to create thumbnail of the pictures (100x100) and it works fine for smaller size images but for images the are big (bigger than 1.5MB), it slows down a lot while resizing and if there are too many of these big files, it actually crashes the app. 

 

I am using an Image object and resizing the image by doing image.setSize(100,100) on load. It does resize but its too slow. Is there a better way? I have also tried getting the bitmap data and resizing it that way but its even slower. 

 

I am resizing just to show the picture as a thumbnail. 

 

Any input is appreciated as this is the main feature of my app. 

 

Thanks

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Resizing images

Are you resizing each time the app is run or are you saving the resized image in your app-storage area so you only have to resize images that have not been resized yet? Also, I would not try to resize all at one. Resize, wait till done, wait a moment, resize next, etc. while an image is waiting to be resized, you can show a place holder image that might have "Processsing..." in it.
Contributor
Posts: 15
Registered: ‎06-11-2011
My Device: 9800
My Carrier: Rogers

Re: Resizing images

This is in a tilelist so when the tile list is loaded, the picture rendered for all the tiles in the view are loaded at once and so all the images are loaded at once. How might I make the process one by one?

 

Thanks!

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Resizing images

Add them to the data provider when they are ready. If you have too many, you will need to have the images smaller or introduce a concept of paged sheets so all the images are not loaded at once.