I'm running into an issue with trying to use the "FromFile" call from the System.Drawing.Image.FromFile namespace, more specifically It doesn't seem to support URI's or WPF's pack paths ( pack://application:,,,/ ), thus I can't figure out how to properly assign the image path. A little help or direction would be appreciated, as this has stumped me for the past few hours and I don't want to end up hard-coding a path.
我遇到了尝试使用System.Drawing.Image.FromFile命名空间中的“FromFile”调用的问题,更具体地来说它似乎不支持URI或WPF的包路径(pack:// application:,, ,/),因此我无法弄清楚如何正确分配图像路径。我会感激一点帮助或方向,因为这让我在过去的几个小时里难以理解,我不想最终硬编码。
1 个解决方案
#1
0
-
You can use
Image
control and itsSource
property.您可以使用Image控件及其Source属性。
-
You can use
System.Windows.Media.Imaging.BitmapImage
class and its constructor orUriSource
property.您可以使用System.Windows.Media.Imaging.BitmapImage类及其构造函数或UriSource属性。
#1
0
-
You can use
Image
control and itsSource
property.您可以使用Image控件及其Source属性。
-
You can use
System.Windows.Media.Imaging.BitmapImage
class and its constructor orUriSource
property.您可以使用System.Windows.Media.Imaging.BitmapImage类及其构造函数或UriSource属性。