0
我畫一條線在PictureBox這樣:畫線的PictureBox和重繪在變焦
horizontalstart = new Point(0, e.Y); //Start point of Horizontal line.
horizontalend = new Point(picbox_mpr.Width, e.Y); //End point of Horizontal line.
verticalstart = new Point(e.X, 0); //Start point of Vertical line
verticalend = new Point(e.X, picbox_mpr.Height); //End point of Vertical line.
然後在漆事件我這樣做:
e.Graphics.DrawLine(redline, horizontalstart, horizontalend); //Draw Horizontal line.
e.Graphics.DrawLine(redline, verticalstart, verticalend); //Draw Vertical line.
很簡單,現在,我的形象可以放大,這裏是我奮鬥的地方..
即使我放大圖像,該如何保持畫出的同一點?
一個好辦法,簡化代碼是尋找到圖形的轉換。如果你不擅長數學,可能有點難以理解,但一旦你掌握了基礎知識,縮放,移動和縮放的代碼變得非常易讀和清晰。 – korhner