Posts

Showing posts from January, 2018

Code to scale JFace/SWT image

Please find the code below ImageDescriptor scaleImage(Display display, ImageDescriptor imageDescriptor, int outMaxWidth, int outMaxHeight) { if (imageDescriptor == null) { return null; } ImageData imageData = imageDescriptor.getImageData(); if (imageData == null) { return imageDescriptor; } int newHeight = outMaxHeight; int newWidth = (imageData.width * newHeight) / imageData.height; if (newWidth > outMaxWidth) { newWidth = outMaxWidth; newHeight = (imageData.height * newWidth) / imageData.width; } // Use GC.drawImage Image outImage = new Image(display, newWidth, newHeight); GC gc = new GC(outImage); Image oldImage = imageDescriptor.createImage(); gc.drawImage(oldImage, 0, 0, imageData.width, imageData.height,

How to make Eclipse e4 RCP App Full-screen and Trimless

Image
To make your Eclipse e4 RCP App full-screen and trimless then you need to find your TrimmedWindow element in Windows & Dialog section of Application.e4xmi file. Add the tag shellMaximized and the persistentState value styleOverride to 8.