Interface ImageDataAtSizeProvider

All Superinterfaces:
ImageDataProvider

public interface ImageDataAtSizeProvider extends ImageDataProvider
Provides an API that is invoked by SWT when an image needs to be drawn at a specified width and height.

Client code must implement this interface to supply ImageData on demand.

Since:
3.132
Restriction:
This class is still experimental API and might be subject to change.
  • Method Details

    • getImageData

      ImageData getImageData(int width, int height)
      Returns the ImageData for the given width and height.

      Implementation notes:

      • Returning null is not permitted. If null is returned, SWT will throw an exception when loading the image.
      • The returned ImageData must match the requested width and height exactly. Implementations should ensure proper resizing and scaling of the image based on the height and width requested
      Parameters:
      width - the desired width of the ImageData to be returned
      height - the desired height of the ImageData to be returned
      Returns:
      the ImageData that exactly matches the requested width and height
      Since:
      3.132