作者xanlich (...)
看板C_Sharp
標題[問題] 有關PictureBox
時間Thu May 29 18:44:53 2008
pictureBox1.Image = System.Drawing.Image.FromFile("out.bmp");
我在寫一個程式, out.bmp是會一直更新, 然後用picturebox來show out.bmp
就是連續動畫了, 但上述指令會把out.bmp 鎖住, 使得程式無法更新out.bmp內容
請問要怎麼解決, 謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.118.107.214
2F:→ EricTsai:好像跟你的問題不太一樣... 05/29 19:22
3F:→ EricTsai:Image img = Image.FromFile(@"C:\test.jpg"); 05/29 19:24
4F:→ EricTsai:Graphics g = Graphics.FromImage(img); 05/29 19:24
5F:→ EricTsai:Image img2 = new Bitmap(img.Width, img.Height, g); 05/29 19:24
6F:→ EricTsai:g.Dispose(); img.Dispose(); 然後後面拿img2來用 05/29 19:25