How to open .img files2/21/2023 ![]() ![]() ![]() PictureBox PictureBox1 = new PictureBox() Using (OpenFileDialog dlg = new OpenFileDialog()) rather than manually calling the Dispose method to ensure proper disposal Wrap the creation of the OpenFileDialog instance in a using statement, As your code is written now, you're trying to use the PictureBox.Image property as if it were a method.Ĭhange your code to look like this (also taking advantage of the using statement to ensure proper disposal, rather than manually calling the Dispose method): private void button1_Click(object sender, EventArgs e) You have to create an instance of the Bitmap class, using the constructor overload that loads an image from a file on disk. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |