Image image = Image.FromFile(@"c:/fp.bmp");
Bitmap bmp = new Bitmap(image);
image.Dispose(); //释放文件占用,这句话很重要
pictureBox1.Image = Rotate(bmp, RotateFlipType.Rotate180FlipNone);

 

 

 

//旋转
private Bitmap Rotate(Bitmap source, RotateFlipType rotateFlipType)
{
Rectangle rect = new Rectangle(0, 0, source.Width, source.Height);
Bitmap target = source.Clone(rect, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
target.RotateFlip(rotateFlipType);
return target;
}

相关文章:

  • 2021-11-26
  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-15
  • 2022-12-23
猜你喜欢
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2021-12-06
  • 2021-11-18
  • 2021-06-28
相关资源
相似解决方案