Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » What is the best way to handle scaling icons?
What is the best way to handle scaling icons? [message #50155] Thu, 09 August 2018 15:34 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
I've been having a lot of troubles with scaling under Windows. I went though the entire GUI to touch it up, testing under 125%, 150%, 175% and 200% scaling. Updated CodeEditor too to properly scale and be aesthetically pleasing.

The one problem is icons. What is the best way to handle this?

As far as I can tell, icons get scaled too, but they look jagged with some filtering smoothing.

Potential solutions:
1. Have multiple icon sizes? 16, 24, 32? Does U++ support multi-res icons or should I do this in code?
2. Use SVG icons? One could do on applications startup some size detection and render SVG icons into some sort of Image?

One problem with this is that RenderSVGImage from Painter package renders a background. I cleared the background and so far it looks like it is working properly. I'll have to render that image onto a bunch of GUI elements to see if transparency and sub pixel rendering is looking good.

Maybe RenderSVGImage should take the background clear color as a parameter?
Re: What is the best way to handle scaling icons? [message #50171 is a reply to message #50155] Fri, 10 August 2018 20:57 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
We were trying to resolve this with hi-dpi support.

Current solution is as follows:

When the main font height reaches certain pixel size, U++ is switched into HIDPI mode. Now icons in .iml now have resolution setting:

- normal
- hidpi
- unknown

In non-HIDPI mode, all hidpi icons in all .iml are scaled down 2x. In HIDPI mode all normal icons in all .iml are scaled 2x up, using special algorithm that I have picked from console emulators... (so it tends to smooth lines in artificial icons).

There are also helper functions like Zx/Zy (scale numbers based on main font size) and DPI (scales numbers 2x in hidpi mode).

Mirek
Previous Topic: Decrease PDF size. Compress images?
Next Topic: DrawArc not working in GTK mode
Goto Forum:
  


Current Time: Fri Mar 29 03:30:03 CET 2024

Total time taken to generate the page: 0.01208 seconds