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