Mega Code Archive

 
Categories / Java Tutorial / SWT
 

Creating an Image From Another Image

To create an image that duplicates another image, or that has a disabled or a grayscale look, use the constructor that takes an Image and a flag: Image image = new Image(display, otherImage, flag); The possible values for flag. ConstantDescription SWT.IMAGE_COPYCreate an exact copy of the image SWT.IMAGE_DISABLECreate an image that has a disabled look SWT.IMAGE_GRAYCreate an image that has the grayscale look