53 lines
1.4 KiB
C#
53 lines
1.4 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 _15_3
|
|
{
|
|
public partial class Form1 : Form
|
|
{
|
|
public Form1()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Open_Click(object sender, EventArgs e)
|
|
{
|
|
OpenFileDialog ofd = new OpenFileDialog();
|
|
ofd.InitialDirectory = @"C:\Users\BI\Pictures\Screenshots";
|
|
ofd.Filter = "Image Files|*.bmp;*.jpg;*.png;*.gif;*.jpeg";
|
|
ofd.RestoreDirectory = true;
|
|
if (ofd.ShowDialog() == DialogResult.OK)
|
|
{
|
|
pictureBox1.Load(ofd.FileName);
|
|
}
|
|
}
|
|
|
|
private void Center_Click(object sender, EventArgs e)
|
|
{
|
|
pictureBox1.SizeMode = PictureBoxSizeMode.CenterImage;
|
|
}
|
|
|
|
private void Stretch_Click(object sender, EventArgs e)
|
|
{
|
|
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
|
|
}
|
|
|
|
private void Zoom_Click(object sender, EventArgs e)
|
|
{
|
|
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
|
|
}
|
|
|
|
private void AutoSize_Click(object sender, EventArgs e)
|
|
{
|
|
pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
|
|
}
|
|
}
|
|
}
|