看板 C_Sharp 關於我們 聯絡資訊
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
EricTsai:http://0rz.tw/9e4dC 05/29 19:11
EricTsai:好像跟你的問題不太一樣... 05/29 19:22
EricTsai:Image img = Image.FromFile(@"C:\test.jpg"); 05/29 19:24
EricTsai:Graphics g = Graphics.FromImage(img); 05/29 19:24
EricTsai:Image img2 = new Bitmap(img.Width, img.Height, g); 05/29 19:24
EricTsai:g.Dispose(); img.Dispose(); 然後後面拿img2來用 05/29 19:25
EricTsai:另外一招 http://support.microsoft.com/kb/309482 05/31 04:06