initialise projects

This commit is contained in:
2024-02-23 11:27:55 +00:00
parent 0818f79406
commit 794efd591b
31 changed files with 1708 additions and 9 deletions

View File

@@ -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;
}
}