[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.nebula] Re: load image to Gallery very slow

Hi Gaston,

Loading and resizing images with SWT is not that fast and with this code, your application is frozen while it processes all images.

You should do the loading and resizing in a separate thread and use setImage after each image processed. Most applications work this way.

Additionnaly, you can post the code you use for resize, there may be possible speed improvements.

--
Nicolas


gaston a écrit :
Hi:
I use swt.image for assign images of the a folder with many images of high sized but is very slow. Next I use the image with xxx.setImage();
I would like you to help me.
This is the code:


Image itemImage;
alleryItem item ;

// files.lenght = 700;

for (int i = 0, n = files.length; i < n; i++) {
    itemImage = new Image(display, files[i].toString());
// resize the image
    item.setImage(resize(itemImage, 640, 480));
    itemImage.dispose();
}


Regards. Gaston