Jump to: navigation, search

Difference between revisions of "Nebula Gallery FAQ"

(New page: ''' Is it my responsibility to dispose of all images and items ?''' Yes, and disposing items will NOT dispose images automatically. You have to dispose image AND items manually using it...)
 
 
Line 12: Line 12:
  
 
- Images are not duplicated by the widget. If you use one single image for several items, you'll have to dispose it only once, after the last item has been disposed.
 
- Images are not duplicated by the widget. If you use one single image for several items, you'll have to dispose it only once, after the last item has been disposed.
 +
 +
 +
'''Redraws and group expansions are very slow, how can I speed up the whole thing ?'''
 +
 +
The gallery widget should be very fast, check for the following things :
 +
 +
- do not use full-size images for items when you only intend to display thumbnails : the widget will resize all images to match the defined item size on every paint operation. Resize images before uging GalleryItem#setImage().
 +
 +
- do you need high quality all the time  ? The widget resizes images with the best graphical settings in SWT : interpolation = HIGH and antialias = ON. You can use setLowQualityOnUserAction() to temporary switch to low quality on scrolling/painting. An additionnal paint will occur with high quality after a few milliseconds.
 +
 +
- do you need high quality at all ? You can use a lower quality using setInterpolation() and setantialias(). This will greatly speed up painting.

Latest revision as of 05:19, 17 June 2009

Is it my responsibility to dispose of all images and items ?

Yes, and disposing items will NOT dispose images automatically.

You have to dispose image AND items manually using item.dispose() and image.dispose()

Notes:

- disposing the gallery widget will automatically dispose all items (but not images)

- disposing a group will automatically dispose all children (but not images)

- Images are not duplicated by the widget. If you use one single image for several items, you'll have to dispose it only once, after the last item has been disposed.


Redraws and group expansions are very slow, how can I speed up the whole thing ?

The gallery widget should be very fast, check for the following things :

- do not use full-size images for items when you only intend to display thumbnails : the widget will resize all images to match the defined item size on every paint operation. Resize images before uging GalleryItem#setImage().

- do you need high quality all the time  ? The widget resizes images with the best graphical settings in SWT : interpolation = HIGH and antialias = ON. You can use setLowQualityOnUserAction() to temporary switch to low quality on scrolling/painting. An additionnal paint will occur with high quality after a few milliseconds.

- do you need high quality at all ? You can use a lower quality using setInterpolation() and setantialias(). This will greatly speed up painting.