Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<ImageData> elementAtZoom) {
return autoScaleImageData(device, elementAtZoom.element(), elementAtZoom.zoom());
}

public static int[] autoScaleUp(int[] pointArray) {
return scaleUp(pointArray, deviceZoom);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
Loading