简体   繁体   中英

.PNG Images Accepted by PictureBox in C#?

I am attempting to add a .PNG image to a PictureBox, but it does not seem to be reading it.

public static String NoteImage_path = Environment.CurrentDirectory + @"\Notes-Images\";
ImageLocation = NoteImage_path + "test" + ".png";

With this exact code, I had no issues adding a .BMP file, so why is there an issue with the .PNG file?

Any help will be appreciated. Thanks!

  1. Add PictureBox on the form
  2. List item
  3. Browse Image property
  4. Resource Context
  5. Import button
  6. Chose Png file.

You can do it by code.

pictureBox1.Load(@"C:\Mine\download.png");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM