Hi, I change mi code, is better, but is a bit slow.
It is better to do with AWT and then convert to SWT for use in the
gallery? The code for Resize is yours and is in your blog.
gallery.addListener(SWT.SetData, new Listener() {
public void handleEvent(Event event) {
GalleryItem item = (GalleryItem) event.item;
int index;
if (item.getParentItem() != null) {
index = item.getParentItem().indexOf(item);
item.setItemCount(0);
} else {
index = gallery.indexOf(item);
item.setItemCount(100);
}
System.out.println( "setData index " + index); //$NON-NLS-1$
// map is a map with file path
Image img = resize(map.get(index), 640,480); item.setImage(img);
item.setText("Item " + index); //$NON-NLS-1$
}
}); Regards.
And Thank you.