Page 1 of 1
RenderOptions.BitmapScalingMode="HighQuality" seems to have no effect when downsampling images
Posted: 20 Jun 2017, 06:00
by nikobarli
In WPF, we can make an image shown smooth in the case of downsampling (e.g 256x256 pixel images shown as 32x32 pixel).
Ref:
http://10rem.net/blog/2010/05/01/crappy ... calingmode
However, the setting seems to have no effect in NoesisGUI in the case of downsampling. Is there anything to be set besides the property RenderOptions.BitmapScalingMode ?
Re: RenderOptions.BitmapScalingMode="HighQuality" seems to have no effect when downsampling images
Posted: 20 Jun 2017, 18:45
by jsantos
That setting activates Trilinear filtering (mipmap interpolation). It is only useful if textures have mipmaps. The default texture provider in Noesis does not generate internal mipmaps. We have plans to incorporate support for DDS in the future (this format allows having the mipmaps inside). But the best alternative is implementing a custom texture provider.
Re: RenderOptions.BitmapScalingMode="HighQuality" seems to have no effect when downsampling images
Posted: 21 Jun 2017, 07:47
by nikobarli
In our case, we often needs to show icons (originally in PNG format) in slightly different sizes (not known exactly, decided following circumstances). Seems no easy solution for the moment...
Re: RenderOptions.BitmapScalingMode="HighQuality" seems to have no effect when downsampling images
Posted: 21 Jun 2017, 08:23
by ai_enabled
Downsampling requires trilinear filtering (which requires mipmaps) as bilinear filtering simply cannot handle downsampling properly - it doesn't have lower resolution images to interpolate pixels.
For us it was quite easy to create a custom texture provider which will provide textures to NoesisGUI with mipmaps generated in runtime.
Re: RenderOptions.BitmapScalingMode="HighQuality" seems to have no effect when downsampling images
Posted: 22 Jun 2017, 15:35
by jsantos
In our case, we often needs to show icons (originally in PNG format) in slightly different sizes (not known exactly, decided following circumstances). Seems no easy solution for the moment...
Is using DDS a valid alternative? If not, the alternative sf improving the texture provider to calculate mipmaps on the fly.
Re: RenderOptions.BitmapScalingMode="HighQuality" seems to have no effect when downsampling images
Posted: 23 Jun 2017, 03:12
by nikobarli
Thanks for the reply @ai_enabled, @jsantos,
We have many icons in PNG and I think it is hard for us to convert them all to DDS. I think I need to go with the custom texture provider approach, but currently have little clue to how to implement it. Do you have any reference code for that ?