Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cases where SVG icons do not scale with the Windows scaling factor #284

Open
georges-hatem opened this issue Nov 3, 2024 · 7 comments
Open

Comments

@georges-hatem
Copy link

Hello,
Browsing the issues, I found a few related to scaling, though I'm not sure if they overlap with this one.

  • link an SVGvirtualImageList to a TMainMenu, the icons do not scale when launched at a higher scaling factor
  • link an SVGvirtualImageList to a programmatically created TSpeedButton, similar scaling issue

Note that, when done at design-time, the button size scales, and the SVG image scales with it, without any manual intervention.

Here is a screenshot of the MenuItem with the small glyph at scaling factor 150%.
Note that, in both cases, manually tweaking the SvgVirtualImageList.Size does impact the icons.

The question is, should it be done manually on program start?
Is there a better way to achieve the expected scaling result?

Thanks

image

@pyscripter
Copy link
Collaborator

SVGvirtualImageList is for old Delphi versions. Use a standard VirutalImageList, linked to an SVGImageCollection instead.

@georges-hatem
Copy link
Author

Got it thanks.
However, the external behavior seems to be the same: scaling isn't done automatically, I have to manually multiply width and height by 1.5 (150% scaling).

Any ideas?

@pyscripter
Copy link
Collaborator

Got it thanks. However, the external behavior seems to be the same: scaling isn't done automatically, I have to manually multiply width and height by 1.5 (150% scaling).

You must be doing something wrong. Read the documentation about the VirtualImageList. The whole point is that DPI scaling is done automatically

@georges-hatem
Copy link
Author

georges-hatem commented Nov 3, 2024

Right, and it does scale automatically except in the cases aforementioned, namely programmatic creation of controls + link of image list, and main menu.

Thanks for your time, I'll see what can be done

@carloBarazzetta
Copy link
Contributor

I'll investigate as soon as possible...

@carloBarazzetta
Copy link
Contributor

Can you give me a zip with a sample example to check the problem?

@georges-hatem
Copy link
Author

SVG-imagelist.zip

Apologies for the delay, got side-tracked.
Easy steps to reproduce: put the SVG image collection and VirtualImageList in a data-module, and not on a form. Attached is a sample.

If I'm not mistaken, data-modules being non-visual will not take scaling into consideration.
But I don't know if this is a Delphi thing or related to SVGIconImageList.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants