Skip to content

Scaling Icons without transparency #71

Closed
eclipse-platform/eclipse.platform.swt
#1790
@amartya4256

Description

@amartya4256

In SWT, in Image's init method (line number 2003), there's a check for transparency which initializes an icon. There can be icons which are not transparent. In that case scaling them would not be possible since the init method is also used by the scaling method win32_getHandle.

The icon for the shell in the top right corner is set by setImages method in Decorations whoch specifically calls a method Display.createIcon which is identical to the block in init in Image (line no. 2003). Now that we have added the functionality of scaling to images. A non-transparent image created by createIcon method is unable to be scaled up using the win32_gethandle method since it doesn't end up in the block. Hence, adding an additional check for image.type == SWT.ICON lets it enter the block and scaled up properly.

We need to discuss on this topic and find out whats necessary.

Image

Also, Display.CreateIcon can be Image.createIcon since we want to create an icon from the Image and also since we allow Display to do certain things by using some public fields in the image, it makes the icon incompatible to be scaled properly by the getHandle method.

Metadata

Metadata

Labels

BugA Derivation of Expected BehaviorHiDPIA HiDPI-Related Issue or FeatureSWTIssue for SWT

Type

No type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions