Recently in doing a picture browsing tool, you need to display image files in PictureBox, including GIF playback. and cannot be exclusive to the program, even if the WinForm program is displaying this graph, it can also delete it in the explorer.
Look at the example on the Internet, light a GIF picture, someone is saying to use a label instead of PictureBox, and then set as a background image, someone said to use GDI + to achieve, some people say creategraphics. In fact, I also preview the film, which has so much trouble. Just the following lines of code are sufficient.
The code is as follows:
Public void ShowImage (string path) {
if ((this.pictureBox1.Image! = null))//release First
{
PictureBox1.Image.Dispose ();
pictureBox1.Image = null;
}
= Image.FromFile (path); // Loading Pictures New // Create a new MemoryStream Img. Save (MSTR, imageformat.gif); // Save this object // Show Img. Dispose (); // release occupancy
File.delete (path); }
Don't climb walls with google:www.gaomn.com.
Heat Map Bar: www.retu8.com
8KMM Gallery: www.8kmm.com
C#winform program, let PictureBox display image (including GIF), and is not occupied, can instantly delete pictures.