private void button1_Click(object sender, EventArgs e) { string imagePath = FileTools.GetImagePath(); try { if (imagePath != null) { image = new Bitmap(BitmapHelper.ReadImageFile(imagePath)); pictureBox1.BackgroundImage = image.Clone(new Rectangle(0, 0, image.Width, image.Height), PixelFormat.Format24bppRgb); } else { pictureBox1.BackgroundImage = null; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void saveButton_Click(object sender, EventArgs e) { BitmapHelper.SaveBitmap(screen); }