Skip to content

Sharp rendering of SVGs passed as InputStream to Image constructor when drawing at arbitrary size #567

@HeikoKlare

Description

@HeikoKlare

On Windows, an image based on an SVG passed as an InputStream to Image(Device, InputSTream) will be drawn sharply at arbitrary size when using the new GC#drawImage(image, x, y, width, height) method. On MacOS and Linux the image will be blurry scaled. This is caused by the input stream data being stored on Windows, as they need to be preserved for creating handles for other zooms on demand anyway. On MacOS and Linux the input stream content is not necessary except for the case the of drawing the image at arbitrary size later on.

To support the same behavior on MacOS and Linux, the input stream content should be stored there as well, such the Image#executeOnImageHandleAtBestFittingSize() method can rendering the image sharply.
In addition, on Linux an image can be refreshed for a new zoom (Image#refreshImageForZoom()), which is also not supported for the case that the image is based on an InputStream. When we store that input stream content anyway, that case is easy to implement and should be realized in a solution for this issue as well.

See eclipse-platform/eclipse.platform.swt#2917

Metadata

Metadata

Labels

HiDPIA HiDPI-Related Issue or FeatureSWTIssue for SWT

Type

No type

Projects

Status

🔖 Ready: Atomic

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions