Community
Participate
Working Groups
Created attachment 261476 [details] Clipboard_Example_ImageTransfer_150_Zoom Steps to reproduce: 1. Switch to High zoom settings 2. Launch ClipboardExample 3. Perform "Open Image" action you can see an image as per DPI settings. 4. Copy and Paste the image to the widget on the right side. Current behavior: Image quality decreases drastically in the ImageTransfer step. Expected behavior: Image quality should be maintained in the ImageTransfer step.
Problem is with ImageTransfer step in Clipboard Example, it doesn't uses new Image APIs meant of High DPI usage. Will submit a patch shortly, targeting for Neon RC1.
New Gerrit change created: https://git.eclipse.org/r/72133
Hi Sravan, Neon RC1 bug, for your review ?
Gerrit change https://git.eclipse.org/r/72133 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=6c57834c58239a93119a59d25acd62a9c9045fd7
Resolving.
If example code has to read internal properties and duplicate parts of DPIUtil, then you know something is wrong. The real fix is probably to fix bug 490213 and then make sure the clipboard only transfers the 100% image.
(In reply to Markus Keller from comment #6) > If example code has to read internal properties and duplicate parts of > DPIUtil, then you know something is wrong. > > The real fix is probably to fix bug 490213 and then make sure the clipboard > only transfers the 100% image. Hi Markus, We don't copy the Image instance on the the clipboard, we actually copy the ImageData(which can be serialized) What we have fixed in ClipboardExample at HighDPI settings: 1. There is an image A which needs to be copied over using Clipboard. 2. Copy Operation: Instead of copying Image#getImage() to the clipboard which is be scaled down to 100% what's currently in use.. so we now copy Image#getImageDataAtCurrentZoom(). 3. Paste Operation: We read the ImageData from the clipboard which is at HighDPI and has to be consumed as-is by target Image B, which can be achieved using ImageDataProvider only, which mandates us to read the System property for deviceZoom.[Yes some cleanup needed now, since change for bug 493462 is in, I can now depend on one System property i.e. deviceZoom] Do you see a better alternate here ?
New Gerrit change created: https://git.eclipse.org/r/72689
(In reply to Eclipse Genie from comment #8) > New Gerrit change created: https://git.eclipse.org/r/72689 Other possible alternate is to expose AutoScaleImageDataProvider class as one of the implementation in SWT for client purpose, but any call on new API can be taken only in Oxygen release.
(In reply to Niraj Modi from comment #9) > (In reply to Eclipse Genie from comment #8) > > New Gerrit change created: https://git.eclipse.org/r/72689 > > Other possible alternate is to expose AutoScaleImageDataProvider class as > one of the implementation in SWT for client purpose, but any call on new API > can be taken only in Oxygen release. Above gerrit patch just removes the old property that has been removed from SWT in RC1, so for correctness of the ClipboardExample code we should get this change in for Neon RC2 itself. If AutoScaleImageDataProvider or a new API for getDevicezoom() is available in future, then the 'deviceZoom' system property can be replaced with that API.
(In reply to Niraj Modi from comment #10) > (In reply to Niraj Modi from comment #9) > > (In reply to Eclipse Genie from comment #8) > > > New Gerrit change created: https://git.eclipse.org/r/72689 > > > > Other possible alternate is to expose AutoScaleImageDataProvider class as > > one of the implementation in SWT for client purpose, but any call on new API > > can be taken only in Oxygen release. > > Above gerrit patch just removes the old property that has been removed from > SWT in RC1, so for correctness of the ClipboardExample code we should get > this change in for Neon RC2 itself. I agree that we shouldn't leave the old system property "swt.enable.autoScale" in the example code. It could be misleading to developers looking at the example code.
Gerrit change https://git.eclipse.org/r/72689 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=30df26433e7d5578fc740b439670a68efb609b26
Verified fix in Build id: I20160519-1730
Please note: 1. Raised bug 494263 to make a similar fix in SWT Snippets library 2. Raised bug 494264 to evaluate the need for any of below new API w.r.t. HighDPI: - AutoScaleImageDataProvider class - or new API for getDevicezoom() method(either in Display or Device class)