0
在三種方式中,我嘗試使用Visual C++ 2010 Express在Windows窗體圖片框中顯示圖像。我用openFileDialog
獲取的文件路徑。下面是三次嘗試:最後一個無差錯或信息的消息顯示在圖像VC++在圖片框內顯示圖像會導致錯誤
1.
pictureBox1->ImageLocation = openFileDialog1->FileName;
2.
Bitmap^ image1;
image1 = gcnew Bitmap(openFileDialog1->FileName, true);
pictureBox1->Image = image1;
3.
pictureBox1->Image = static_cast<Bitmap ^>(Image::FromFile(openFileDialog1->FileName));
之前彈出。消息窗口沒有名稱BM6
(打開Bimap-Image),nothing
(打開JPEG圖像)或?PNG[]
(打開PNG圖像)。
問題:如何在圖片框內顯示圖片時避免這些消息?