ImageData getImageData (int zoom) { return DPIUtil.autoScaleImageData(device, this.getImageDataAtCurrentZoom(), zoom, currentDeviceZoom); }
if (shfi.hIcon != 0) { Image image = Image.win32_new (null, SWT.ICON, shfi.hIcon); ImageData imageData = image.getImageDataAtCurrentZoom (); image.dispose (); return imageData; if (phiconSmall [0] == 0) return null; Image image = Image.win32_new (null, SWT.ICON, phiconSmall [0]); ImageData imageData = image.getImageDataAtCurrentZoom (); image.dispose (); return imageData;
/** * 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); }
gc.dispose (); original.dispose (); ImageData result = resultImage.getImageDataAtCurrentZoom (); resultImage.dispose (); return result;
mask = createMask(getImageDataAtCurrentZoom(), false); if (mask == 0) SWT.error(SWT.ERROR_NO_HANDLES);
gc.dispose (); original.dispose (); ImageData result = resultImage.getImageDataAtCurrentZoom (); resultImage.dispose (); return result;
gc.dispose (); original.dispose (); ImageData result = resultImage.getImageDataAtCurrentZoom (); resultImage.dispose (); return result;
gc.dispose (); original.dispose (); ImageData result = resultImage.getImageDataAtCurrentZoom (); resultImage.dispose (); return result;
mask = createMask(getImageDataAtCurrentZoom(), false); if (mask == 0) SWT.error(SWT.ERROR_NO_HANDLES);
mask = createMask(getImageDataAtCurrentZoom(), false); if (mask == 0) SWT.error(SWT.ERROR_NO_HANDLES);
Image createButtonImage(Display display, int button) { GC tempGC = new GC (this); Point size = renderer.computeSize(button, SWT.NONE, tempGC, SWT.DEFAULT, SWT.DEFAULT); tempGC.dispose(); Rectangle trim = renderer.computeTrim(button, SWT.NONE, 0, 0, 0, 0); Image image = new Image (display, size.x - trim.width, size.y - trim.height); GC gc = new GC (image); RGB transparent; if (button == CTabFolderRenderer.PART_CHEVRON_BUTTON) { transparent = new RGB(0xFF, 0xFF, 0xFF); } else { transparent = new RGB(0xF7, 0, 0); } Color transColor = new Color(display, transparent); gc.setBackground(transColor); gc.fillRectangle(image.getBounds()); renderer.draw(button, SWT.NONE, new Rectangle(trim.x, trim.y, size.x, size.y), gc); gc.dispose (); transColor.dispose(); final ImageData imageData = image.getImageDataAtCurrentZoom(); imageData.transparentPixel = imageData.palette.getPixel(transparent); image.dispose(); image = new Image(display, new AutoScaleImageDataProvider(display, imageData, DPIUtil.getDeviceZoom())); return image; } void createItem (CTabItem item, int index) {
Image createButtonImage(Display display, int button) { GC tempGC = new GC (this); Point size = renderer.computeSize(button, SWT.NONE, tempGC, SWT.DEFAULT, SWT.DEFAULT); tempGC.dispose(); Rectangle trim = renderer.computeTrim(button, SWT.NONE, 0, 0, 0, 0); Image image = new Image (display, size.x - trim.width, size.y - trim.height); GC gc = new GC (image); RGB transparent; if (button == CTabFolderRenderer.PART_CHEVRON_BUTTON) { transparent = new RGB(0xFF, 0xFF, 0xFF); } else { transparent = new RGB(0xF7, 0, 0); } Color transColor = new Color(display, transparent); gc.setBackground(transColor); gc.fillRectangle(image.getBounds()); renderer.draw(button, SWT.NONE, new Rectangle(trim.x, trim.y, size.x, size.y), gc); gc.dispose (); transColor.dispose(); final ImageData imageData = image.getImageDataAtCurrentZoom(); imageData.transparentPixel = imageData.palette.getPixel(transparent); image.dispose(); image = new Image(display, new AutoScaleImageDataProvider(display, imageData, DPIUtil.getDeviceZoom())); return image; } void createItem (CTabItem item, int index) {
Image createButtonImage(Display display, int button) { GC tempGC = new GC (this); Point size = renderer.computeSize(button, SWT.NONE, tempGC, SWT.DEFAULT, SWT.DEFAULT); tempGC.dispose(); Rectangle trim = renderer.computeTrim(button, SWT.NONE, 0, 0, 0, 0); Image image = new Image (display, size.x - trim.width, size.y - trim.height); GC gc = new GC (image); RGB transparent; if (button == CTabFolderRenderer.PART_CHEVRON_BUTTON) { transparent = new RGB(0xFF, 0xFF, 0xFF); } else { transparent = new RGB(0xFD, 0, 0); } Color transColor = new Color(display, transparent); gc.setBackground(transColor); gc.fillRectangle(image.getBounds()); renderer.draw(button, SWT.NONE, new Rectangle(trim.x, trim.y, size.x, size.y), gc); gc.dispose (); transColor.dispose(); final ImageData imageData = image.getImageDataAtCurrentZoom(); imageData.transparentPixel = imageData.palette.getPixel(transparent); image.dispose(); image = new Image(display, new AutoScaleImageDataProvider(display, imageData, DPIUtil.getDeviceZoom())); return image; } void createItem (CTabItem item, int index) {
Image createButtonImage(Display display, int button) { GC tempGC = new GC (this); Point size = renderer.computeSize(button, SWT.NONE, tempGC, SWT.DEFAULT, SWT.DEFAULT); tempGC.dispose(); Rectangle trim = renderer.computeTrim(button, SWT.NONE, 0, 0, 0, 0); Image image = new Image (display, size.x - trim.width, size.y - trim.height); GC gc = new GC (image); RGB transparent; if (button == CTabFolderRenderer.PART_CHEVRON_BUTTON) { transparent = new RGB(0xFF, 0xFF, 0xFF); } else { transparent = new RGB(0xF7, 0, 0); } Color transColor = new Color(display, transparent); gc.setBackground(transColor); gc.fillRectangle(image.getBounds()); renderer.draw(button, SWT.NONE, new Rectangle(trim.x, trim.y, size.x, size.y), gc); gc.dispose (); transColor.dispose(); final ImageData imageData = image.getImageDataAtCurrentZoom(); imageData.transparentPixel = imageData.palette.getPixel(transparent); image.dispose(); image = new Image(display, new AutoScaleImageDataProvider(display, imageData, DPIUtil.getDeviceZoom())); return image; } void createItem (CTabItem item, int index) {
ImageData data = image.getImageDataAtCurrentZoom(); OS.DeleteObject(memDib); image.dispose();
ImageData data = getImageDataAtCurrentZoom(); destroy (); ImageData resizedData = DPIUtil.autoScaleImageData(device, data, deviceZoomLevel, currentDeviceZoom);
int deviceZoomLevel = deviceZoom; if (deviceZoomLevel != currentDeviceZoom) { ImageData data = getImageDataAtCurrentZoom(); destroy (); ImageData resizedData = DPIUtil.autoScaleImageData(device, data, deviceZoomLevel, currentDeviceZoom);
static Image createIcon (Image image) { Device device = image.getDevice (); ImageData data = image.getImageDataAtCurrentZoom (); if (data.alpha == -1 && data.alphaData == null) { ImageData mask = data.getTransparencyMask ();