Image stretch out in Unity
Hi,
My problem is that a picture I have put in a Path as an ImageBrush stretch out in Unity instead of following the value UniformToFill. I tested on blend, it works perfectly but once I test on unity, the picture stretch out (but not the same way it would have stretch with the Fill value)
On blend:
On unity:
Any idea?
My problem is that a picture I have put in a Path as an ImageBrush stretch out in Unity instead of following the value UniformToFill. I tested on blend, it works perfectly but once I test on unity, the picture stretch out (but not the same way it would have stretch with the Fill value)
Code: Select all
<Grid Grid.Row="0" Grid.RowSpan="3">
<Path Margin="0 0 0 0" Data="M-0.5,-0.5 L-0.5,449.5 399.5,449.5 304.5,-0.5 z">
<Path.Fill>
<ImageBrush ImageSource="./../Images/example.jpg" Stretch="UniformToFill"/>
</Path.Fill>
</Path>
</Grid>
On unity:
Any idea?
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Image stretch out in Unity
Could you please attach the original image so we can do some tests and analyze what is happening?
If the behavior between Blend and Unity is different it could probably be a bug in Noesis.
If the behavior between Blend and Unity is different it could probably be a bug in Noesis.
Re: Image stretch out in Unity
Here is a link to the original image : https://imgur.com/a/yMkFJgi
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Image stretch out in Unity
Is it possible that you are resizing the image in Unity to the nearest power of 2? Try setting "Non-Power of 2" to "None".
Noesis deals directly with Unity's texture, so we know about texture dimensions, not the original image size.
Noesis deals directly with Unity's texture, so we know about texture dimensions, not the original image size.
Re: Image stretch out in Unity
I was thinking about this, if we should consider the original image dimensions before Unity converts to texture. But it seems it is not possible:
Unity does not provide a documented API for accessing the width and height of a texture asset before any processing has been applied by the texture importer. So if you have a texture that measures 210x210 in Photoshop, when imported into Unity the texture will likely read 256x256 due to NPOT and/or maximum resolution.
Who is online
Users browsing this forum: Bing [Bot] and 18 guests