Stop scaling icons loaded from resources in wxMSW (PR #26370)

11 views
Skip to first unread message

VZ

unread,
Apr 9, 2026, 8:16:41 PM (2 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed

This is not backwards compatible but looks like the right thing to do because old behaviour was inconsistent: using LoadIcon() meant that we always loaded icons of the given (system default size) which meant that some icons were upscaled while the others were not, e.g. in a system using 200% scaling 16x16 icons were loaded as 32x32 ones, but so were 32x32 icons too.

Use LoadImage() to load the image in its actual size, where "actual" means the size of the first icon for icons with multiple bitmaps. This might not be the best thing to do and maybe we should load the default icon size if the icon provides it, which could be done in a way similar to what we do in MSW-specific wxIconBundle::AddIcon().

Not scaling the icons means that they always use scale of 1, which makes things behave correctly for DPI-unaware applications that were broken before, which seems better even if it breaks DPI-aware applications: but those should be using wxBitmapBundle, which still works correctly.

Closes #26369.


I'd really like to get some testing/feedback for this one because it's clearly backwards incompatible. But this seems the right thing to do — or, at least, using LoadIcon() as we did before is very clearly a wrong thing to do, for the reasons explained above.

Please let me know what does this break and let's see if we can repair it without going to the old behaviour. TIA!


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26370

Commit Summary

  • 35257e2 Stop scaling icons loaded from resources in wxMSW

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26370@github.com>

Reply all
Reply to author
Forward
0 new messages