[.NET] picturebox匯入影像檔後再畫線的問題

看板Visual_Basic作者時間17年前 (2009/01/08 11:47), 編輯推噓0(004)
留言4則, 1人參與, 最新討論串1/1
請輸入專案類型(網站專案或者應用程式專案):VB 2005 想請問各位大大 當我的程式中 picturebox1.image = new bitmap("圖檔路徑") 接著我想要在這個圖上面畫線 gra = PictureBox1.CreateGraphics gra.DrawLines(greenpen, box) 但是程式執行時,畫出來的線會閃一下就消失了 似乎像是被圖檔覆蓋過去 請問有什麼辦法可以保留畫出來的線在圖片上嗎 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.130.89.78

01/08 15:08, , 1F
dim b as bitmap = new bitmap("<圖片檔名>")
01/08 15:08, 1F

01/08 15:08, , 2F
dim g as graphics = graphics.fromimage(b)
01/08 15:08, 2F

01/08 15:09, , 3F
這樣對g的所有修改都會反映到b上
01/08 15:09, 3F

01/08 15:09, , 4F
最後再把 b 指定給 picbox. picturebox1.image = b
01/08 15:09, 4F
文章代碼(AID): #19PNT5Vm (Visual_Basic)