0
我有这样更改默认图像从资源
if (image == "") {
pictureBoxImage.Image = Properties.Resources.noimage;
}
else{
pictureBoxImage.ImageLocation = Path.Combine(Global.myPictureLocation, image);
pictureBoxImage.BringToFront();
}
,直到我从资源文件夹设置默认的形象,工作正常,编辑表单代码。如果我从资源文件夹设置的图像,而不是浏览图片的代码去错误.... 我尝试MODIF像这样
if (image == Properties.Resources.noimage) {
pictureBoxImage.Image = Properties.Resources.noimage;
}
else{
pictureBoxImage.ImageLocation = Path.Combine(Global.myPictureLocation, image);
pictureBoxImage.BringToFront();
}
,但它会与错误...
操作“ ==”不能应用于类型的操作数‘串’和‘System.Drawing.Bitmap’
如何正确的方式来检测,如果它的形象从资源或不?
ü可以给一个想法怎么做合适? – Neversaysblack
@ user3184196你可以比较图像文件本身,或使用图像标签 – 2014-01-15 06:25:50
仍然混淆....也许你可以给我例:) – Neversaysblack