Page 1 of 1

Cannot read image file using BitmapImage with absolute path ? (C++ SDK 2.0.2f2)

Posted: 20 Jun 2017, 10:21
by nikobarli
I tried to read a PNG file using the following code (the file V1.png exists under D:\ directory, and not broken):
   Ptr<BitmapSource> _source = *new BitmapImage("D:\\V1.png");
But it resulted in an error given by Noesis error callback
Unable to load image 'D:\V1.png', filename Gui\Core\Src\BitmapImage.cpp, line 150)
Could you tell me what's wrong with the code ? Is my URI format was wrong ?

Re: Cannot read image file using BitmapImage with absolute path ? (C++ SDK 2.0.2f2)

Posted: 20 Jun 2017, 16:34
by sfernandez
Are you using local providers with a non-empty root path? Something like:
Noesis::GUI::SetResourceProvider("Data/UI");

Re: Cannot read image file using BitmapImage with absolute path ? (C++ SDK 2.0.2f2)

Posted: 21 Jun 2017, 07:51
by nikobarli
Are you using local providers with a non-empty root path? Something like:
Noesis::GUI::SetResourceProvider("Data/UI");
Yes, I am setting local providers with a non-empty root path.

Re: Cannot read image file using BitmapImage with absolute path ? (C++ SDK 2.0.2f2)

Posted: 22 Jun 2017, 15:30
by jsantos
It is a bug in our default providers, they always prepend the localroot path to the received URI. Could you please create a ticket about it? The workaround right now is implementing your own provider.

Re: Cannot read image file using BitmapImage with absolute path ? (C++ SDK 2.0.2f2)

Posted: 23 Jun 2017, 03:51
by nikobarli
Thanks. I filed the issue here: https://bugs.noesisengine.com/view.php?id=1114