kenneth quirici

kenneth quirici

  • NA
  • 378
  • 1.7k

loading picturebox image from file

Dec 25 2020 12:25 AM
I tried these two approaches. Neither worked - the picture box remains empty. How can I fix the code? I must be missing something obvious.
 
1.
  1. if (File.Exists(saveImageFileName))  
  2. {  
  3.    MessageBox.Show("Image file exists");  
  4.    tempImage = Image.FromFile(saveImageFileName);  
  5.    pictureBox.Image = tempImage;  
  6. } 
2
  1. if (File.Exists(saveImageFileName))  
  2. {  
  3.    MessageBox.Show("Image file exists");  
  4.    pictureBox.Image = new Bitmap(saveImageFileName); ;  
  5. } 
 

Answers (5)