예제 #1
0
        // Place clip points, maximum 4
        private void ImagePanel_MouseClick(object sender, MouseEventArgs e)
        {
            if (ClipPoints.Count < 4)
            {
                Point p = ImagePanel.PanelToImage(e.Location);
                if (p.X < 0 || p.Y < 0 || p.X > ImagePanel.img.Width || p.Y > ImagePanel.img.Height)
                {
                    return;
                }

                ClipPoints.Add(p);

                if (ClipPoints.Count == 4)
                {
                    ImageClipButton.Enabled = true;
                }
            }
        }