[C++] Using absolute path
Posted: 19 Apr 2017, 15:48
Have a component which uses image. Using ImageSource with absolute path like "C:\data\image.png" not works. Relative path works.
Welcome to our official discussion site. You’ll find topics on features, bugs, development, and general support here
https://www.noesisengine.com/forums/
https://www.noesisengine.com/forums/viewtopic.php?f=3&t=1070
Absolute URIs
-------------
For Absolute URIs the specified location is sent without modifications to the `Resource Provider <Gui.Core.ProvidersTutorial.html>`_.
Absolute URIs start with '/' and might be preceded by *pack://application:,,,* and/or a reference to a WPF project like */Sample;component*:
.. admonition::
NOTE
The name of the project, Sample.csproj in this case, is ignored by Noesis.
.. code-block:: xml
<Image Source="pack://application:,,,/Images/icon.png" />
.. code-block:: xml
<Image Source="pack://application:,,,/Sample;component/Images/icon.png" />
.. code-block:: xml
<Image Source="/Sample;component/Images/icon.png" />
.. code-block:: xml
<Image Source="/Images/icon.png" />
In all these cases, resource providers will receive the path "*Images/icon.png*"" when being asked to load the asset.
Paths beginning with a drive letter are also considered absolute:
.. code-block:: xml
<Image Source="C:/Images/icon.png" />
In this case the entire path is passed to the resource provider "*C:/Images/icon.png*".