diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java index 0f08710d468..40dd39211c6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java @@ -346,10 +346,6 @@ public static ImageData autoScaleUp (Device device, final ImageData imageData) { return autoScaleImageData(device, imageData, 100); } -public static ImageData autoScaleUp (Device device, final ElementAtZoom elementAtZoom) { - return autoScaleImageData(device, elementAtZoom.element(), elementAtZoom.zoom()); -} - public static int[] autoScaleUp(int[] pointArray) { return scaleUp(pointArray, deviceZoom); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java index 9a114a3150c..d086604d3df 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java @@ -363,8 +363,9 @@ public Image(Device device, ImageData data) { super(device); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); initialNativeZoom = DPIUtil.getNativeDeviceZoom(); - data = DPIUtil.autoScaleUp(device, new ElementAtZoom<>(data, 100)); - init(data, getZoom()); + int deviceZoom = getZoom(); + data = DPIUtil.scaleImageData(device, new ElementAtZoom<>(data, 100), deviceZoom); + init(data, deviceZoom); init(); this.device.registerResourceWithZoomSupport(this); } @@ -471,8 +472,9 @@ public Image(Device device, ImageData source, ImageData mask) { public Image (Device device, InputStream stream) { super(device); initialNativeZoom = DPIUtil.getNativeDeviceZoom(); - ImageData data = DPIUtil.autoScaleUp(device, new ElementAtZoom<>(new ImageData (stream), 100)); - init(data, getZoom()); + int deviceZoom = getZoom(); + ImageData data = DPIUtil.scaleImageData(device, new ElementAtZoom<>(new ImageData (stream), 100), deviceZoom); + init(data, deviceZoom); init(); this.device.registerResourceWithZoomSupport(this); } @@ -513,8 +515,9 @@ public Image (Device device, String filename) { super(device); if (filename == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); initialNativeZoom = DPIUtil.getNativeDeviceZoom(); - ImageData data = DPIUtil.autoScaleUp(device, new ElementAtZoom<>(new ImageData (filename), 100)); - init(data, getZoom()); + int deviceZoom = getZoom(); + ImageData data = DPIUtil.scaleImageData(device, new ElementAtZoom<>(new ImageData (filename), 100), deviceZoom); + init(data, deviceZoom); init(); this.device.registerResourceWithZoomSupport(this); }