Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void toolStripRotateClockwise_Click(object sender, EventArgs e)
- {
- Image i = pictureBox1.Image;
- i.RotateFlip(RotateFlipType.Rotate90FlipNone);
- pictureBox1.Image = i;
- }
- private void toolStripRotateCounterClockwise_Click(object sender, EventArgs e)
- {
- Image i = pictureBox1.Image;
- i.RotateFlip(RotateFlipType.Rotate270FlipNone);
- pictureBox1.Image = i;
- }
- private void toolStripButtonPreviousImage_Click(object sender, EventArgs e)
- {
- if (counter > 0)
- {
- counter -= 1;
- }
- else
- {
- counter = fileNames.Length - 1;
- }
- pictureBox1.Load(fileNames[counter]); // Exception: ImageLocation must be set.
- }
- private void toolStripButtonNextImage_Click(object sender, EventArgs e)
- {
- string directoryPath = Path.GetDirectoryName(openFileDialog1.FileName);
- DirectoryInfo di = new DirectoryInfo(directoryPath);
- FileInfo[] fi = di.GetFiles();
- fileNames = new string[fi.Length];
- int j = 0;
- foreach (FileInfo fi2 in fi)
- {
- if (fi2.Extension == ".jpg" || fi2.Extension == ".jpeg" || fi2.Extension == ".gif" || fi2.Extension ==
- ".bmp" || fi2.Extension == ".png")
- {
- fileNames[j] = fi2.FullName;
- j++;
- }
- }
- if (counter < fileNames.Length - 1)
- {
- counter += 1;
- }
- else
- {
- counter = 0;
- }
- pictureBox1.Load(fileNames[counter]); // Exception: ImageLocation must be set.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement