Rectangle rectangle = new Rectangle(Math.Min(m_iX1,m_iX2),Math.Min(m_iY1,m_iY2),Math.Abs(m_iX2-m_iX1),Math.Abs(m_iY2-m_iY1));
Offset
method of that Rectangle
. That change will only need to be done once and will be persistent. You could also call the TranslateTransform
method of the Graphics
object used in the Paint
event handler but that's probably less intuitive. I'd only do that if you needed to call RotateTransform
as well.