コード例 #1
0
        private void loadImageMainMenu_Click(object sender, EventArgs e)
        {
            OpenFileDialog fileDialog = new OpenFileDialog();

            fileDialog.Title  = "Open image";
            fileDialog.Filter = "Image Files (*.bmp;*.jpg;*.jpeg,*.png)|*.BMP;*.JPG;*.JPEG;*.PNG";

            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                imgBox.Image = new Bitmap(fileDialog.FileName);
            }

            sight = new Sight(imgBox.Image, radiusDisplayed, imgBox.Size, zoomedImgBox.Size);
            userPoints.SetSight(sight);
            selectedPoints.SetSight(sight);
            axisPoints.SetSight(sight);
            ProcessImageColors();
        }
コード例 #2
0
        private void imgBox_DragDrop(object sender, DragEventArgs e)
        {
            try
            {
                imgBox.Image = null;
                string[] filename = (string[])e.Data.GetData(DataFormats.FileDrop);
                imgBox.Image = Image.FromFile(filename[0]);
                sight        = new Sight(imgBox.Image, radiusDisplayed, imgBox.Size, zoomedImgBox.Size);
                userPoints.SetSight(sight);
                selectedPoints.SetSight(sight);
                axisPoints.SetSight(sight);


                ProcessImageColors();
            }
            catch (OutOfMemoryException ex)
            {
                MessageBox.Show(ex.Message + "\n\n\nCheck image file format.");
            }
        }
コード例 #3
0
 public void SetSight(Sight sight)
 {
     this.sight = sight;
 }