simonb
Topic Author
Posts: 24
Joined: 22 May 2021, 16:35

Cannot find Image in Unity

27 Sep 2021, 14:50

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?
 
simonb
Topic Author
Posts: 24
Joined: 22 May 2021, 16:35

Re: Cannot find Image in Unity

29 Sep 2021, 13:00

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 :)
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Cannot find Image in Unity

29 Sep 2021, 19:18

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>
 
simonb
Topic Author
Posts: 24
Joined: 22 May 2021, 16:35

Re: Cannot find Image in Unity

29 Sep 2021, 19:22

ah great - thanks for letting me know
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Cannot find Image in Unity

30 Sep 2021, 11:37

I will mark this as solved, #2135 will be fixed in 3.1.2

Who is online

Users browsing this forum: Google [Bot] and 67 guests