-
Notifications
You must be signed in to change notification settings - Fork 4
Picture
greipadmin edited this page Jan 27, 2019
·
15 revisions
This widget simply shows a Picture. Supported picture formats: PNG, BMP, JPEG, GIF (including animated GIFs), ICO and TIFF.
-
Picture(Composite parent, int style)
-
parent
a widget which will be the parent of the new Picture widget. -
style
the style of widget to construct.
-
-
void loadImage(String filename)
loads an image from the file with the specified name. -
void loadImage(InputStream stream)
loads an image from the specified input stream. -
void setImage(Image image)
sets the image. -
void scaleTo(Point size)
scale the image to specified size. Default isPoint(SWT.DEFAULT, SWT.DEFAULT)
, that means the original image size.Point(100, SWT.DEFAULT)
means scale to width 100px and calculate the new height. -
void setBorderWidth(int width)
sets the border width. -
int getBorderWidth()
returns the current border width. -
void setBorderColor(Color color)
sets the border color. -
Color getBorderColor()
returns the current border color. -
void setCornerRadius(int radius)
set the radius of rounded corners. -
int getCornerRadius()
returns the radius of rounded corners.
The size of the widget is the scaled size of the image. Is no image loaded, the size is Point(0, 0)
.