Loading PictureBox Image from resource file with path (Part 3)

前端 未结 5 871
北荒
北荒 2020-12-03 07:19

I understand that this question has been asked (and answered) before. However, none of the solutions are working for me.

Below is a screen capture of all the relevan

5条回答
  •  情深已故
    2020-12-03 07:46

    The accepted answer has major drawback!
    If you loaded your image that way your PictureBox will lock the image,so if you try to do any future operations on that image,you will get error message image used in another application!
    This article show solution in VB

    and This is C# implementation

     FileStream fs = new System.IO.FileStream(@"Images\a.bmp", FileMode.Open, FileAccess.Read);
      pictureBox1.Image = Image.FromStream(fs);
      fs.Close();
    

提交回复
热议问题