Resource/Image path
Hi guys, anyd idea how not to end with neverending "../../../" ?
Of course, I've tried just "./" and "~/" but no success :/
cheers!
Code: Select all
<Grid Width="100" Height="100">
<Image Grid.Column="1" Source="../../../../../../Images/Carta/CameraIcon.png"></Image>
</Grid>
cheers!
Re: Resource/Image path
What do you exactly mean? We support two kind of URIs (compatible with WPF): absolute and relative.
By default, a relative pack URI is considered relative to the location of the XAML that contains the reference. For example:
Absolute URIs are considered relative to the root of the project (.csproj) indicated. For example:
In this example, the Images folder must be located next to the project file, Sample.csproj in this case.
By default, a relative pack URI is considered relative to the location of the XAML that contains the reference. For example:
Code: Select all
<Image Source="Images/icon.png" />
Code: Select all
<Image Source="/Sample;component/Images/icon.png" />
Re: Resource/Image path
This is explained a bit better in the v1.2 documentation: Gui.Core.URIs.html (cannot link to it because v1.2 documentation is yet not online)
Re: Resource/Image path
Hi, it is still not working for me
nor this:
with error:
Unable to open C:/WinDevelopment/Pruebas/PruebaXamlUnity/PruebaXamlUnity/Assets/Libraries/IOrder.Lib.UI/Views/Assets
/Images/Common/logo.png
neither these others
nor this:
Code: Select all
<Image Source="/UnityVS.PruebaXamlUnity.CSharp;component/Images/Common/logo.png" />
Unable to open C:/WinDevelopment/Pruebas/PruebaXamlUnity/PruebaXamlUnity/Assets/Libraries/IOrder.Lib.UI/Views/Assets
/Images/Common/logo.png
neither these others
Code: Select all
<Image Source="/UnityVS.PruebaXamlUnity.CSharp;component/Assets/Images/Common/logo.png" />
<Image Source="/PruebaXamlUnity.CSharp;component/Images/Common/logo.png" />
<Image Source="/PruebaXamlUnity;component/Images/Common/logo.png" />
<Image Source="Assets/Images/Common/logo.png" />
etc..
-
-
sfernandez
Site Admin
- Posts: 2062
- Joined:
Re: Resource/Image path
Hi Genom,
By the error message you are getting I guess you are working with 1.1 version, right?
Unfortunately, in that version your only option when referencing resources from other folder branch is to use "../".
The "/Sample;component/Images/icon.png" option that is more appropriate for what you are looking for, is only working as explained by jsantos, in 1.2 version.
By the error message you are getting I guess you are working with 1.1 version, right?
Unfortunately, in that version your only option when referencing resources from other folder branch is to use "../".
The "/Sample;component/Images/icon.png" option that is more appropriate for what you are looking for, is only working as explained by jsantos, in 1.2 version.
Who is online
Users browsing this forum: No registered users and 0 guests