我有一个如下的人员类,以图像为属性。我试图弄清楚如何在我的程序类中创建person 类的实例,并将对象的图像设置为文件路径,例如C:\Users\Documents\picture.jpg。我该怎么办?
public class Person
{
public string firstName { get; set; }
public string lastName { get; set; }
public Image myImage { get; set; }
public Person()
{
}
public Person(string firstName, string lastName, Image image)
{
this.fName = firstName;
this.lName = lastName;
this.myImage = image;
}
}