-
Notifications
You must be signed in to change notification settings - Fork 4
Picture
greipadmin edited this page Feb 4, 2017
·
15 revisions

This widget simply shows a Picture. Supported picture formats: PNG, BMP, JPEG, GIF (including animated GIFs), ICO and TIFF.
- loadImage(String) or loadImage(InputStream) loads images from file.
- setImage(Image) sets the image.
- setMinDelay(int) defines the delay between two images in animated GIFs. Default is 50 ms.
- getMinDelay() gets the current delay.
The size of the widget is the size of the image. Is no image loaded, the size is Point(0, 0).
final Picture picture = new Picture(shell, SWT.BORDER);
final FileDialog dialog = new FileDialog(shell);
dialog.setFilterExtensions(new String[] { "*.bmp;*.gif;*.jpg;*.png" });
final String filename = dialog.open();
if (filename != null) {
picture.loadImage(filename);
}