erehh

image viewer stuff

Dec 26th, 2022
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3. this.Close();
  4. }
  5.  
  6. private void button_showPicture_Click(object sender, EventArgs e)
  7. {
  8. if (openFileDialog1.ShowDialog() == DialogResult.OK)
  9. {
  10. pictureBox1.Load(openFileDialog1.FileName);
  11. }
  12. }
  13.  
  14. private void button_setbg_Click(object sender, EventArgs e)
  15. {
  16. if (colorDialog1.ShowDialog() == DialogResult.OK)
  17. {
  18. pictureBox1.BackColor = colorDialog1.Color;
  19. }
  20. }
  21.  
  22. private void button_clear_Click(object sender, EventArgs e)
  23. {
  24. pictureBox1.Image = null;
  25. }
  26.  
  27. private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
  28. {
  29.  
  30. }
  31.  
  32. private void checkBox_stetch_CheckedChanged(object sender, EventArgs e)
  33. {
  34. if (checkBox_stretch.Checked)
  35. pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
  36. else
  37. pictureBox1.SizeMode = PictureBoxSizeMode.Normal;
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment