void ClipRoi(Area roi) { Point st = roi.Start; st.X = Math.Max (st.X, 0); st.Y = Math.Max (st.Y, 0); st.X = Math.Min (st.X, (Background.Width - roi.Width)); st.Y = Math.Min (st.Y, (Background.Height - roi.Height)); }