Package org.eclipse.swt.internal
Class Win32DPIUtils
java.lang.Object
org.eclipse.swt.internal.Win32DPIUtils
This class is used in the win32 implementation only to provide
DPI related utility methods.
IMPORTANT: This class is not part of the public API for SWT. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.
- Restriction:
- This class is not intended to be referenced by clients
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAutoScale ImageDataProvider. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThis property allows to customize the DPI awareness of the application's UI thread, such that different DPI awareness modes are supported via configuration and not only via the application's executable manifest. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intstatic booleanstatic booleanstatic float[]pixelToPoint(float[] size, int zoom) static float[]pixelToPoint(Drawable drawable, float[] size, int zoom) static floatpixelToPoint(Drawable drawable, float size, int zoom) static intpixelToPoint(Drawable drawable, int size, int zoom) static RectanglepixelToPoint(Drawable drawable, Rectangle rect, int zoom) static RectanglepixelToPoint(Rectangle rect, int zoom) static PointpixelToPointAsLocation(Drawable drawable, Point point, int zoom) static PointpixelToPointAsLocation(Point point, int zoom) static PointpixelToPointAsSize(Drawable drawable, Point point, int zoom) static PointpixelToPointAsSize(Point point, int zoom) static PointpixelToPointAsSufficientlyLargeSize(Point point, int zoom) static RectanglepixelToPointWithSufficientlyLargeSize(Rectangle rect, int zoom) static floatpointToPixel(float size, int zoom) static int[]pointToPixel(int[] pointArray, int zoom) static floatpointToPixel(Drawable drawable, float size, int zoom) static int[]pointToPixel(Drawable drawable, int[] pointArray, int zoom) static intpointToPixel(Drawable drawable, int size, int zoom) static RectanglepointToPixel(Drawable drawable, Rectangle rect, int zoom) static RectanglepointToPixel(Rectangle rect, int zoom) static PointpointToPixelAsLocation(Drawable drawable, Point point, int zoom) static PointpointToPixelAsLocation(Point point, int zoom) static PointpointToPixelAsSize(Drawable drawable, Point point, int zoom) static PointpointToPixelAsSize(Point point, int zoom) static PointpointToPixelAsSufficientlyLargeSize(Point point, int zoom) static RectanglepointToPixelWithSufficientlyLargeSize(Rectangle rect, int zoom) static <T> TrunWithProperDPIAwareness(Display display, Supplier<T> operation) static RectanglescaleBounds(Rectangle rect, int targetZoom, int currentZoom) Returns a new rectangle as per the scaleFactor.static booleansetDPIAwareness(long desiredDpiAwareness)
-
Field Details
-
CUSTOM_DPI_AWARENESS_PROPERTY
This property allows to customize the DPI awareness of the application's UI thread, such that different DPI awareness modes are supported via configuration and not only via the application's executable manifest. Supported modes are "System", "PerMonitor", and "PerMonitorV2".- See Also:
-
-
Constructor Details
-
Win32DPIUtils
public Win32DPIUtils()
-
-
Method Details
-
initializeCustomDpiAwareness
public static boolean initializeCustomDpiAwareness() -
setDPIAwareness
public static boolean setDPIAwareness(long desiredDpiAwareness) -
hasProperDpiAwarenessForMonitorSpecificScaling
public static boolean hasProperDpiAwarenessForMonitorSpecificScaling() -
runWithProperDPIAwareness
-
pixelToPoint
public static float[] pixelToPoint(float[] size, int zoom) -
pixelToPoint
-
pixelToPoint
-
pixelToPoint
-
pixelToPointAsSize
-
pixelToPointAsLocation
-
pixelToPointAsSize
-
pixelToPointAsLocation
-
pixelToPointAsSufficientlyLargeSize
-
pixelToPoint
-
pixelToPointWithSufficientlyLargeSize
-
pixelToPoint
-
scaleBounds
Returns a new rectangle as per the scaleFactor. -
pointToPixel
public static int[] pointToPixel(int[] pointArray, int zoom) -
pointToPixel
-
pointToPixel
-
pointToPixel
public static float pointToPixel(float size, int zoom) -
pointToPixel
-
pointToPixelAsSize
-
pointToPixelAsLocation
-
pointToPixelAsSize
-
pointToPixelAsSufficientlyLargeSize
-
pointToPixelAsLocation
-
pointToPixel
-
pointToPixelWithSufficientlyLargeSize
-
pointToPixel
-
getPrimaryMonitorZoomAtStartup
public static int getPrimaryMonitorZoomAtStartup()
-