64 lines
1.8 KiB
C#
64 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace workshop2
|
|
{
|
|
public partial class Form1 : Form
|
|
{
|
|
public Form1()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void pictureBox1_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void openFileButton_Click(object sender, EventArgs e)
|
|
{
|
|
openFileDialog1.ShowDialog();
|
|
pictureBox1.Load(openFileDialog1.FileName);
|
|
//pictureBox1.Size = pictureBox1.Image.Size;
|
|
pictureBox1.SizeMode = AutoSize(true);
|
|
}
|
|
|
|
private void quitButton_Click(object sender, EventArgs e)
|
|
{
|
|
Application.Exit();
|
|
}
|
|
|
|
private void rotateLeft_Click(object sender, EventArgs e)
|
|
{
|
|
Bitmap image = new Bitmap(pictureBox1.Image);
|
|
image.RotateFlip(RotateFlipType.Rotate270FlipNone);
|
|
pictureBox1.Image = image;
|
|
pictureBox1.Refresh();
|
|
}
|
|
|
|
private void rotateRight_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
Bitmap image = new Bitmap(pictureBox1.Image);
|
|
image.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
|
pictureBox1.Image = image;
|
|
pictureBox1.Refresh();
|
|
}
|
|
|
|
private void Form1_Load(object sender, EventArgs e)
|
|
{
|
|
this.MinimumSize = new System.Drawing.Size(this.Width, this.Height);
|
|
this.MaximumSize = new System.Drawing.Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
|
|
this.AutoSize = true;
|
|
this.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
|
}
|
|
}
|
|
}
|