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