You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add snippet for demonstrating options to programmatically create images
With the implementation of monitor-specific UI scaling on Windows, an
SWT application does not have a static zoom anymore. The zoom will be
specific for each shell and the monitor it is currently placed on. As a
consequence, when programmatically creating an image, the target zoom at
which it will be used is not known when creating the image anymore.
Instead, it will depend on the context in which the image is used later
on. There are multiple options how to achieve that such an image will
still be rendered at the according zoom in a sharp way instead of
rendering it at an arbitrary zoom and then scaling it in a blurry way.
This snippet demonstrates these different options and also a common way
for programmatic image creation that will lead to blurry results.
Copy file name to clipboardExpand all lines: examples/org.eclipse.swt.snippets/Snippets.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -216,6 +216,7 @@ To contribute a new snippet, [create a snippet contribution as a pull request](h
216
216
-[draw a disabled/grayed image at various zoom levels](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet382.java) – [(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet382.png"Preview for Snippet 382")
217
217
-[compare algorithms for rendering disabled images](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet384.java) – [(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet384.png"Preview for Snippet 384")
218
218
-[draw an image with watermark using ImageGcProvider](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet385.java) – [(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet385.png"Preview for Snippet 385")
219
+
-[options for programmatically creating an image](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet387.java) – [(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet387.png"Preview for Snippet 387")
219
220
220
221
### **ImageData**
221
222
-[display an animated GIF](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet141.java)
0 commit comments