Creates and returns a new SWT image for this image descriptor. Note that each call returns a new SWT image object. The returned image must be explicitly disposed using the image's dispose call. The image will not be automatically garbage collected. A default image is returned in the event of an error.
Note: this method differs from createResource(Device) in that the returned image must be disposed directly, whereas an image obtained from createResource(...) must be disposed by calling destroyResource(...). It is not possible to mix-and-match. If you obtained the Image from this method, you must not dispose it by calling destroyResource. Clients are encouraged to use create/destroyResource and downcast the result to Image rather than using createImage.
Note: it is still possible for this method to return null
in extreme cases, for example if SWT runs out of image handles.
@return a new image or
null
if the image could not becreated