Hello,
I have this C# code but I get the error in the title. on the "FromFile" part. I want to simply publish images in my PC on a WPF application.
How can I get rid of this error?
Thanks.
Code :
using System.Drawing;
namespace Photo
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
string filename1 = @"C:\images\mainicon.jpg";
Image image1 = Image.FromFile(filename1);
}
}
}
Error :
'System.Windows.Controls.Image' does not contain a definition for 'FromFile'