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

This widget simply shows a Picture. Supported picture formats: PNG, BMP, JPEG, GIF (including animated GIFs), ICO and TIFF.
- Picture(Composite parent) or Picture(Composite parent, Point imageSize)
- parent the parent Composite
- imageSize the scaled size of the image. Use SWT.DEFAULT for the original image height/width.
- loadImage(String) or loadImage(InputStream) loads images from file.
- setImage(Image) sets the image.
The size of the widget is the scaled 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);
}