Exemplo n.º 1
0
        // application is opened with file(s) passing in
        public HideNSeek(string[] imgs)
        {
            InitializeComponent();

            // only the first image will be processed
            // pass the selected file to check whether it is an image
            if (ImgProcessing.isImg(imgs[0]))
            {
                Reinitialize("", "File Selected: " + imgs[0], imgs[0], new Bitmap(imgs[0]));
            }
            else
            {
                MessageBox.Show("Error: This image is not supported", "Alert");
            }
        }
Exemplo n.º 2
0
        private void Open_Click(object sender, EventArgs e)
        {
            // open the file browser
            OpenFileDialog dlg = new OpenFileDialog
            {
                Title            = "Select an image",
                InitialDirectory = "C:/"
            };

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                if (ImgProcessing.isImg(dlg.FileName))
                {
                    Reinitialize("", "File Selected: " + dlg.FileName, dlg.FileName, new Bitmap(dlg.FileName));
                }
                else
                {
                    MessageBox.Show("Error: This image is not supported", "Alert");
                }
            }
        }