コード例 #1
0
            private KeyValuePair <int, int> GetMouseLocalCoordinates()
            {
                System.Drawing.Point coords = RenderArea.PointToClient(Control.MousePosition);

                return(new KeyValuePair <int, int>(Math.Min(Math.Max(0, coords.X), RenderArea.Width - 1),
                                                   Math.Min(Math.Max(0, coords.Y), RenderArea.Height - 1)));
            }