Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            String filter = "JPEG files (*.jpg)|*.jpg| Bitmaps (*.bmp)|*.bmp";
            OpenFileDialog openF = new OpenFileDialog();
            openF.Multiselect = false;
            if (filter.Length > 0) { openF.Filter = filter; }

            if (openF.ShowDialog(this) != DialogResult.Cancel)
            {
                if (openF.FileName != null)
                {
                    pictureBox1.Image = new Bitmap(openF.FileName);
                    tF = new TransformImage((Bitmap)pictureBox1.Image);
                }
            }
        }
Esempio n. 2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            String filter = "JPEG files (*.jpg)|*.jpg| Bitmaps (*.bmp)|*.bmp";
            OpenFileDialog openF = new OpenFileDialog();
            openF.Multiselect = false;
            if (filter.Length > 0) { openF.Filter = filter; }

            if (openF.ShowDialog(this) != DialogResult.Cancel)
            {
                if (openF.FileName != null)
                {
                    pictureBox1.Image = new Bitmap(openF.FileName);
                    tF = new TransformImage((Bitmap)pictureBox1.Image);
                }
            }
            MessageBox.Show("Otwarto plik " + openF.FileName.ToString());
        }