Exemple #1
0
        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
            //if (_pointInfo == null)
            //{
            //    return;
            //}

            //Rectangle r = new Rectangle(
            //                                        _pointInfo.X,
            //                                        _pointInfo.Y,
            //                                        _pointInfo.Width,
            //                                        _pointInfo.Height);
            //if(r.Contains(e.X, e.Y))
            //{
            //    AddButton.Text = "OK";
            //}
            //else
            //{
            //    AddButton.Text = "NG";
            //}
            //using (var path = new System.Drawing.Drawing2D.GraphicsPath())
            //{
            //    path.AddEllipse(_pointInfo.X,
            //                            _pointInfo.Y,
            //                            _pointInfo.Width,
            //                            _pointInfo.Height);
            //    if (path.IsVisible(e.X, e.Y))
            //    {
            //        AddButton.Text = "OK";
            //    }
            //    else
            //    {
            //        AddButton.Text = "NG";
            //    }

            //if (DrawHelper.IsEllipse(_pointInfo.X,
            //                        _pointInfo.Y,
            //                        _pointInfo.Width,
            //                        _pointInfo.Height,
            //                        e.X,
            //                        e.Y))
            //{
            //    AddButton.Text = "OK";
            //    _isMove = true;
            //}
            //else
            //{
            //    AddButton.Text = "NG";
            //    _isMove = false;
            //}

            foreach (var pointInfo in _pointInfos)
            {
                if (DrawHelper.IsEllipse(pointInfo.X,
                                         pointInfo.Y,
                                         pointInfo.Width,
                                         pointInfo.Height,
                                         e.X,
                                         e.Y))
                {
                    _selectedPointInfo = pointInfo;
                    break;
                }
            }
        }
Exemple #2
0
 private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
 {
     //_isMove = false;
     _selectedPointInfo = null;
 }