Page 1 of 1

[C++] Using absolute path

Posted: 19 Apr 2017, 15:48
by realesmedia
Have a component which uses image. Using ImageSource with absolute path like "C:\data\image.png" not works. Relative path works.

Re: [C++] Using absolute path

Posted: 20 Apr 2017, 18:30
by sfernandez
Could you please create a ticket in our bugtracker.
This kind of absolute paths are not supported yet but it is something we are fixing for the next release.

Re: [C++] Using absolute path

Posted: 21 Apr 2017, 01:28
by jsantos
Please, do not create the ticket because we already added support for this. This is the documentation about absolute paths in 2.0.1 (to be released today or tomorrow):
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*".
Note that absolute URIs using "pack://application:,,," already works in 2.0.0.

Thanks!