Interface ImageGcDrawer

All Known Implementing Classes:
TransparencyColorImageGcDrawer

public interface ImageGcDrawer
Interface to provide a callback mechanism to draw on different GC instances depending on the zoom the image will be used for. A common use case is when the application is moved from a low DPI monitor to a high DPI monitor. This provides API which will be called by SWT during the image rendering. This interface needs to be implemented by client code to provide logic that draws on the empty GC on demand.
Since:
3.129
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    drawOn(GC gc, int imageWidth, int imageHeight)
    Draws an image on a GC for a requested zoom level.
    default void
    Executes post processing on ImageData.
  • Method Details

    • drawOn

      void drawOn(GC gc, int imageWidth, int imageHeight)
      Draws an image on a GC for a requested zoom level.
      Parameters:
      gc - The GC will draw on the underlying Image and is configured for the targeted zoom
      imageWidth - The width of the image in points to draw on
      imageHeight - The height of the image in points to draw on
    • postProcess

      default void postProcess(ImageData imageData)
      Executes post processing on ImageData. This method will always be called after drawOn and contain the resulting ImageData.
      Parameters:
      imageData - The resulting ImageData after drawOn was called