C#实现图片的旋转功能

WinForms直接提供了图片旋转的功能,相对来说比较方便。
示例代码:

var bitmap = Bitmap.FromFile(fileName);
if (clockwise)
{
    bitmap.RotateFlip(RotateFlipType.Rotate90FlipNone);
}
else
{
    bitmap.RotateFlip(RotateFlipType.Rotate270FlipNone);
}
bitmap.Save(tempFileName, System.Drawing.Imaging.ImageFormat.Png);
posted @ 2023-09-08 15:36  wzwyc  阅读(533)  评论(0)    收藏  举报