Add snippet for demonstrating options to programmatically create images #2581
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.