Page 1 of 1

Cannot find Image in Unity

Posted: 27 Sep 2021, 14:50
by simonb
Hi
I am trying to get to grips with Noesis and am trying to load an image as a background for a UI screen.

The following works fine in blend:
<Grid>
        <Viewbox x:Name="Background" Stretch="UniformToFill">
            <Viewbox.Effect>
                <BlurEffect Radius ="4"/>
            </Viewbox.Effect>
            <Image Source="/Assets/Images/mapeditor.jpg"/>
        </Viewbox>
</Grid>
But throws the following error in Unity...

[NOESIS/E] Assets/GUI/XAML/NewWindow2.xaml(22): Image not found 'Assets/Images/mapeditor.jpg'

I've tried removing the initial '/' & also added a specific dependency
<noesis:Xaml.Dependencies>
        <noesis:Dependency Source="/Assets/Images/mapeditor.jpg"/>
</noesis:Xaml.Dependencies>
but nothing seems to work.

Am I missing something really simple here?

Re: Cannot find Image in Unity

Posted: 29 Sep 2021, 13:00
by simonb
Arrgg!

Finally figured this out. Passing it along in case it helps anyone else in the future.

The actual image files extension was 'JPG' while the code was 'jpg'.
Blend is not case sensitive, but NOESIS is :)

Re: Cannot find Image in Unity

Posted: 29 Sep 2021, 19:18
by sfernandez
This is in fact a bug in our Unity plugin, the resource providers should be doing a case-insensitive comparisson of the uris.
I created ticket #2135 in our bugtracker to fix it, thanks for letting us know.

On a side note, I see you are using a Viewbox with an Image inside, probably to stretch the image to fill the screen. The Image control already has a property to configure the desired stretching:
<Grid>
  <Image Source="/Assets/Image/mapeditor.jpg" Stretch="UniformToFill">
    <Image.Effect>
      <BlurEffect Radius="4"/>
    </Image.Effect>
  </Image>
</Grid>

Re: Cannot find Image in Unity

Posted: 29 Sep 2021, 19:22
by simonb
ah great - thanks for letting me know

Re: Cannot find Image in Unity

Posted: 30 Sep 2021, 11:37
by jsantos
I will mark this as solved, #2135 will be fixed in 3.1.2