Hi,
I'm trying to load a PNG file from the local disc at runtime, and am getting confused with getting absolute path URIs working, and also the best way to load the image in (FileStream / ByteArray/ etc.).
Given an absolute path...
string myPath = "C:\pic.png";
...I want to load the image into a WriteableBitmap.
I keep getting "Unsupported URI syntax. Method expects a relative URI or a pack://siteoforigin:,,,/ form of absolute URI". I understand this is because the end-user's drive mapping may be different and so once cannot specify a drive path per se, but I can't find any useful examples of how to accomplish this simple task. Or is URI even the correct way of accomplishing what I want?
I need to load at runtime into WriteableBitmap using a method such as .FromByteArray or .FromStream. or whatever works.
The file is not part of the project and so I cannot use .FromResource (this is because my function is loading half a dozen images out of 10,000 on the disc).
Thanks for any help.