Grid Background Image
Maybe I'm doing something wrong here but once I set an ImageBrush for Grid.Background the background is really blury. I've tried all type of fills such as fill, uniform fill, none etc. still the image is blury.
Cropped image on the right shows what the quality of the image should look like.

Any help with this is appreciated.
Code: Select all
<Grid.Background>
<ImageBrush ImageSource="Resources/bg.png" Stretch="UniformToFill"/>
</Grid.Background>

Any help with this is appreciated.
Re: Grid Background Image
For efficiency and compatibility reasons image dimensions are converted to power of two before being converted to textures. The blurriness can be avoided if your image has already that format.
Re: Grid Background Image
These are the settings I have for my image are these correct? I still am getting blurriness.


Re: Grid Background Image
Stretch must be set to None. Besides that, we don't use the parameters passed in the Unity importer for images, we use our own algorithm to mimic WPF behavior. It seems that your texture is 2048 x 1024, I have done a quick test with an image of similar dimensions:
And the result is quite acceptable. Little artifacts due to texture compression but good quality. Could you test with this XAML?
If the result is still incorrect, I am going need to have a look at that image. If you don't want to share it publicly you can file a bug with it.
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" UseLayoutRounding="True">
<Grid.Background>
<ImageBrush ImageSource="bg.jpg" Stretch="None" AlignmentX="Center" AlignmentY="Center"/>
</Grid.Background>
</Grid>
If the result is still incorrect, I am going need to have a look at that image. If you don't want to share it publicly you can file a bug with it.
Re: Grid Background Image
The image is actually 1920x1080. Wouldn't I need to use a stretch setting so it would work for any resolution? Here is the http://www.roguereturns.com/background.png
Re: Grid Background Image
Yes, in case you want to support any resolution you need to use UniformToFill.
The differences between Unity and noesisGUI are due to the bilinear setting you are using in the Unity image importer. With this settings Unity avoids using mipmaps. This way you get sharper images but with the risk of generating aliasing. For example, you can try to reduce the image by a high factor and you will see that the result is not acceptable.
If you activate trilinear in Unity you will see that the result is similar to noesisGUI default. In this case the aliasing is fought by adding blurriness. For now, we don't have option for chaging this behaviour. We should implement the attached property RenderOptions.BitmapScalingMode. For example:
If this is important to you please, file us a bug to prioritize this task. Although, as said, in this option extra aliasing is generated (note that WPF calls this mode LowQuality)
The differences between Unity and noesisGUI are due to the bilinear setting you are using in the Unity image importer. With this settings Unity avoids using mipmaps. This way you get sharper images but with the risk of generating aliasing. For example, you can try to reduce the image by a high factor and you will see that the result is not acceptable.
If you activate trilinear in Unity you will see that the result is similar to noesisGUI default. In this case the aliasing is fought by adding blurriness. For now, we don't have option for chaging this behaviour. We should implement the attached property RenderOptions.BitmapScalingMode. For example:
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" UseLayoutRounding="True"
RenderOptions.BitmapScalingMode="LowQuality"
>
<Grid.Background >
<ImageBrush ImageSource="background.png" Stretch="UniformToFill" AlignmentX="Center" AlignmentY="Center"/>
</Grid.Background>
</Grid>
Re: Grid Background Image
Fixed in v1.1.8
Who is online
Users browsing this forum: Google [Bot] and 3 guests