HiDPI not working on 4K display

My Windows app is HiPDI enabled and it is looking sharp on my Surface Book so it does look it is HiPDI enabled.
But I have 2 customers who have a 4K displays running Windows 10, say the app is looking blurred and not sharp as it should.

Any thoughts why this happens?

Maybe a different scale factor (e.g. not 200 %)?

It seems they have it set to 125%. But shouldn’t everything still be sharp?

No. Icons / images are getting blurry e.g.
But everything else should be sharp.

[quote=339925:@Stefan Adelsberger]No. Icons / images are getting blurry e.g.
But everything else should be sharp.[/quote]
That’s not entirely true. Icons and images get scaled down from the next highest resolution.

In this case, if the user’s screen is at 125%, then it’s the 2x image of an image set that is used and scaled down to fit. That doesn’t mean that the image should be blurry. To expand on this, the width/height of the image does make a huge difference in the quality of that scale. At 125% This means that every 1.6 pixels of the 2x image is squeezed down to make the image of the correct size. The smaller the image, the worse it appears.

You can remedy this by dynamically loading images yourself and building them instead of using Image objects in the IDE.

We talked about how to handle fractional scales, like 125%, at XDC 2016
Greg gave the presentation “Supporting Retina and HiDPI in Your Applications”

In the meantime the two users confirms everything is sharp when set scaling to 200% - but there system says 125% is the recommended setting.
Anyhow, so it is a scaling issue. I was under the impression enabling HiDPI did resolve all this.

@Greg: Can you elaborate with the ‘… dynamically loading images yourself and building them instead of using Image objects …’
Any examples how to do this?

Right now images support 1x 2x and 3x (integral scales) and will pick the larger item and scale down where needed
Thats the issue in play here
While Direct2d etc do a nicer job of scaling pictures they cant overcome drastic scaling where you will see artifacts

Say you wanted to look even better on Windows where fractional scales like 125%, 150%, 175% (and even others that are not nice 25% increments) are possible you might need more images than an image set currently supports to reduce the amount you need to scale

In that event you’d literally need to provide maybe 5 pictures on disk and load “the next larger one” and scale it down to the required size

You could name them
image100.png
image125.png
image150.png
image175.png
image200.png


And then you’d have to load & scale the images manually to the currently used scale factor
The framework cant do it automagically for you like it does with images

Actually let me test something Greg just asked
There might be a different way to make this easier

What should (or seems to work is) to provide several (maybe 5) pictures on disk

You could name them
image100.png
image125.png
image150.png
image175.png
image200.png

And then you’d have to load each one and create a new image from all the pictures
see http://documentation.xojo.com/index.php/Picture.Constructor(width_as_Integer,_height_as_Integer,_bitmaps()_As_Picture)

Then the framework can select the right one
You just cant set this up in the ide

I thought there was an FR already for this but could not find one so I made one

<https://xojo.com/issue/48695>

Here’s an example project: FractionalRezTest

[quote=339999:@Norman Palardy]What should (or seems to work is) to provide several (maybe 5) pictures on disk

You could name them
image100.png
image125.png
image150.png
image175.png
image200.png

And then you’d have to load each one and create a new image from all the pictures
see http://documentation.xojo.com/index.php/Picture.Constructor(width_as_Integer,_height_as_Integer,_bitmaps()_As_Picture)

Then the framework can select the right one
You just cant set this up in the ide[/quote]

Nice to know - thanks Norman.

I’m having a lot of issues with blurry text and images on Windows for fractional OS zooms of 125%, 150% etc on HiDPI and normal resolution displays with my HiDPI enabled app. Things work great for 100% and 200%. I’m using BitmapForCaching throughout to create new picture objects. Currently using 2017 R 1.1. Is there any improvement on this in the latest release? If not, can someone point me to some relevant forum posts or dev doc links about how to handle this because I’ve searched and haven’t found anything? Norman mentioned a post called"Supporting Retina and HiDPI in Your Applications" but I can’t find it. Thanks.

[quote=339919:@Christoph De Vocht]My Windows app is HiPDI enabled and it is looking sharp on my Surface Book so it does look it is HiPDI enabled.
But I have 2 customers who have a 4K displays running Windows 10, say the app is looking blurred and not sharp as it should.

Any thoughts why this happens?[/quote]

How does their system text font look, let’s say on their desktop icons?
I’ve had the same windows doesn’t allow my mac bootcamp to show a good blurry-text-and-icon-free reslution.

Greg,

I know that post is old but…

Why would you take that approach rather than constructing a multiple image picture in code and letting the framework automatically choose which one to use (Or use Picture.BestRepresenation depending on the situation)?

My understanding is that an “imageSet” constructed in code does not have the limitations of one constructed in the IDE and can have any number of images in it as long as they have the same aspect ratio… That would be more general than using fixed ratios, but would use them when you have an exact match. Is that right?

I hope so, because I recently wrote code that depends on that! I aways try to use framework functionality rather than reinventing the wheel when I can.

  • karen

[quote=355632:@Karen Atkocius]Greg,

I know that post is old but…

Why would you take that approach rather than constructing a multiple image picture in code and letting the framework automatically choose which one to use (Or use Picture.BestRepresenation depending on the situation)?

My understanding is that an “imageSet” constructed in code does not have the limitations of one constructed in the IDE and can have any number of images in it as long as they have the same aspect ratio… That would be more general than using fixed ratios, but would use them when you have an exact match. Is that right?

I hope so, because I recently wrote code that depends on that! I aways try to use framework functionality rather than reinventing the wheel when I can.

  • karen[/quote]

Is my understanding of how things work right?

Thanks,

  • karen