Three lines were drawn previous, but one of them needs to be removed later. Does anyone knows how to do it? Thanks for your commants.
三選一 1.用底色重畫 2.用 Line 控制項 3.用 MetaFile, PlayRecord 時處理! 4.其他
Lian-Lian, thank you for your comments. 1. Draw over the line to be removed with the background color, but it would leave a gap in the other lines if they cross. 2. Use Line control, but there can be various items, eg. curves... 3. Clear the PictureBox and redraw the lines omitting the one to be removed, but there can be too many items in various types. 4. How can remember the formular which was used to draw the one which needs to be removed now. 5. Could you please give an example about the solution with MetaFile, PlayRecord? Thanks. 6. If you (or anybody else) know how to add new PictureBoxes in run-time, could you please also teach me? Thanks!
5.直接看 MSDN 即可! 不過對 MetaFile 而言, 畫面幾乎透過重繪來更新, 與你的 3 相衝! 6.線上手冊就有例子了 其他: 以前在做繪圖時, 有的時候會埰用將繪圖記憶體複製, 畫上去後若要移除, 再將記憶體複製回來, 不嫌煩的話, MSDN 這種例子滿多的
我以前的做法是使用DrawMode = Not Xor Pen 的方式去畫,如果要去除時 只要再重畫一次就可以去除了
說的是... 忘了還有運算子可以用... ^_^'
Thanks, Lian-Lian and CWW.