Looking into opening an image on a blazor page's @code section, but I keep getting the following error.
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\img\Account\Pamphlet Design.png'
Here is the code that I have tried among other:
var path = Path.Combine(Environment.ContentRootPath, @"/img/Account/Pamphlet Design.png");
var plampletBitmap = new Bitmap(path); // Error Here
ContentRootPathcontains, you'd end up with apaththat starts at the disk's root. At the very least use"img/Account/Pamphlet Design.png".Directory.GetCurrentDirectory()does return the correct path, and I was able to load it through that. I will test the path without the/imgnow.