@Override public ImageData getImageData(int zoom) { return DPIUtil.autoScaleImageData(device, imageData, zoom, currentZoom); } }
@Override public ImageData getImageData(int zoom) { return DPIUtil.autoScaleImageData(device, imageData, zoom, currentZoom); } }
/** * Auto-scale image with ImageData */ public static ImageData autoScaleImageData (Device device, final ImageData imageData, int targetZoom, int currentZoom) { if (deviceZoom == 100 || imageData == null || targetZoom == currentZoom) return imageData; float scaleFactor = (float) targetZoom / (float) currentZoom; return autoScaleImageData(device, imageData, scaleFactor); }
@Override public ImageData getImageData(int zoom) { return DPIUtil.autoScaleImageData(device, imageData, zoom, currentZoom); } }
@Override public ImageData getImageData(int zoom) { return DPIUtil.autoScaleImageData(device, imageData, zoom, currentZoom); } }
/** * Auto-scale image with ImageData */ public static ImageData autoScaleImageData (Device device, final ImageData imageData, int targetZoom, int currentZoom) { if (deviceZoom == 100 || imageData == null || targetZoom == currentZoom || (device != null && !device.isAutoScalable())) return imageData; float scaleFactor = (float) targetZoom / (float) currentZoom; return autoScaleImageData(device, imageData, scaleFactor); }
ImageData getImageData (int zoom) { return DPIUtil.autoScaleImageData(device, this.getImageDataAtCurrentZoom(), zoom, currentDeviceZoom); }
/** * Auto-scale down ImageData */ public static ImageData autoScaleDown (Device device, final ImageData imageData) { if (deviceZoom == 100 || imageData == null) return imageData; float scaleFactor = 1.0f / getScalingFactor (); return autoScaleImageData(device, imageData, scaleFactor); }
/** * Auto-scale up ImageData */ public static ImageData autoScaleUp (Device device, final ImageData imageData) { if (deviceZoom == 100 || imageData == null) return imageData; float scaleFactor = getScalingFactor (); return autoScaleImageData(device, imageData, scaleFactor); }
/** * Auto-scale image with ImageData */ public static ImageData autoScaleImageData (Device device, final ImageData imageData, int targetZoom, int currentZoom) { if (deviceZoom == 100 || imageData == null || targetZoom == currentZoom || (device != null && !device.isAutoScalable())) return imageData; float scaleFactor = (float) targetZoom / (float) currentZoom; return autoScaleImageData(device, imageData, scaleFactor); }
/** * Auto-scale image with ImageData */ public static ImageData autoScaleImageData (Device device, final ImageData imageData, int targetZoom, int currentZoom) { if (deviceZoom == 100 || imageData == null || targetZoom == currentZoom || (device != null && !device.isAutoScalable())) return imageData; float scaleFactor = (float) targetZoom / (float) currentZoom; return autoScaleImageData(device, imageData, scaleFactor); }
/** * Auto-scale up ImageData */ public static ImageData autoScaleUp (Device device, final ImageData imageData) { if (deviceZoom == 100 || imageData == null || (device != null && !device.isAutoScalable())) return imageData; float scaleFactor = getScalingFactor (); return autoScaleImageData(device, imageData, scaleFactor); }
/** * Auto-scale down ImageData */ public static ImageData autoScaleDown (Device device, final ImageData imageData) { if (deviceZoom == 100 || imageData == null || (device != null && !device.isAutoScalable())) return imageData; float scaleFactor = 1.0f / getScalingFactor (); return autoScaleImageData(device, imageData, scaleFactor); }
/** * Auto-scale down ImageData */ public static ImageData autoScaleDown (Device device, final ImageData imageData) { if (deviceZoom == 100 || imageData == null || (device != null && !device.isAutoScalable())) return imageData; float scaleFactor = 1.0f / getScalingFactor (); return autoScaleImageData(device, imageData, scaleFactor); }
/** * Auto-scale up ImageData */ public static ImageData autoScaleUp (Device device, final ImageData imageData) { if (deviceZoom == 100 || imageData == null || (device != null && !device.isAutoScalable())) return imageData; float scaleFactor = getScalingFactor (); return autoScaleImageData(device, imageData, scaleFactor); }
/** * Auto-scale down ImageData */ public static ImageData autoScaleDown (Device device, final ImageData imageData) { if (deviceZoom == 100 || imageData == null || (device != null && !device.isAutoScalable())) return imageData; float scaleFactor = 1.0f / getScalingFactor (); return autoScaleImageData(device, imageData, scaleFactor); }
/** * Auto-scale up ImageData */ public static ImageData autoScaleUp (Device device, final ImageData imageData) { if (deviceZoom == 100 || imageData == null || (device != null && !device.isAutoScalable())) return imageData; float scaleFactor = getScalingFactor (); return autoScaleImageData(device, imageData, scaleFactor); }
/** * Returns an <code>ImageData</code> for specified zoom, based on the receiver * Modifications made to this <code>ImageData</code> will not affect the * Image. * * @param zoom * The zoom level in % of the standard resolution (which is 1 * physical monitor pixel == 1 SWT logical pixel). Typically 100, * 150, or 200. * @return an <code>ImageData</code> containing the image's data and * attributes at specified zoom if present else null is returned. * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_INVALID_IMAGE - if the image is not a bitmap or an icon</li> * </ul> * * @see ImageData * * @since 3.105 */ ImageData getImageData (int zoom) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return DPIUtil.autoScaleImageData (device, getImageDataAtCurrentZoom (), zoom, currentDeviceZoom); }
/** * Returns an <code>ImageData</code> for specified zoom, based on the receiver * Modifications made to this <code>ImageData</code> will not affect the * Image. * * @param zoom * The zoom level in % of the standard resolution (which is 1 * physical monitor pixel == 1 SWT logical pixel). Typically 100, * 150, or 200. * @return an <code>ImageData</code> containing the image's data and * attributes at specified zoom if present else null is returned. * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_INVALID_IMAGE - if the image is not a bitmap or an icon</li> * </ul> * * @see ImageData * * @since 3.105 */ ImageData getImageData (int zoom) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return DPIUtil.autoScaleImageData (device, getImageDataAtCurrentZoom (), zoom, currentDeviceZoom); }
/** * Returns an <code>ImageData</code> for specified zoom, based on the receiver * Modifications made to this <code>ImageData</code> will not affect the * Image. * * @param zoom * The zoom level in % of the standard resolution (which is 1 * physical monitor pixel == 1 SWT logical pixel). Typically 100, * 150, or 200. * @return an <code>ImageData</code> containing the image's data and * attributes at specified zoom if present else null is returned. * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_INVALID_IMAGE - if the image is not a bitmap or an icon</li> * </ul> * * @see ImageData * * @since 3.105 */ ImageData getImageData (int zoom) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return DPIUtil.autoScaleImageData (device, getImageDataAtCurrentZoom (), zoom, currentDeviceZoom); }