initialise projects
This commit is contained in:
@@ -26,6 +26,21 @@ namespace advancedpictureviewer
|
||||
pictureBox1.Image = bitmap1;
|
||||
fileSizeLabel.Text = openFileDialog1.FileName.Length.ToString();
|
||||
}
|
||||
|
||||
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if ( saveFileDialog1.ShowDialog() == DialogResult.OK )
|
||||
{
|
||||
int width = Convert.ToInt32(pictureBox1.Image.Width);
|
||||
int height = Convert.ToInt32(pictureBox1.Image.Height);
|
||||
using (Bitmap bmp = new Bitmap(width, height))
|
||||
{
|
||||
pictureBox1.DrawToBitmap( bmp, new Rectangle( 0,0, width, height ) );
|
||||
bmp.Save( saveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Png );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Application.Exit();
|
||||
@@ -45,13 +60,13 @@ namespace advancedpictureviewer
|
||||
|
||||
private void toolButton_RotY_Click(object sender, EventArgs e)
|
||||
{
|
||||
bitmap1.RotateFlip(RotateFlipType.Rotate270FlipNone);
|
||||
bitmap1.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
pictureBox1.Image = bitmap1;
|
||||
}
|
||||
|
||||
private void toolButton_RotL_Click(object sender, EventArgs e)
|
||||
{
|
||||
bitmap1.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
bitmap1.RotateFlip(RotateFlipType.Rotate270FlipNone);
|
||||
pictureBox1.Image = bitmap1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user