加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Bitmap 图片旋转

发布时间:2020-12-14 04:41:19 所属栏目:大数据 来源:网络整理
导读:#region 图片旋转 public static void rotating(Bitmap img,ref int width,ref int height) { int ow = width; int orien = 1; foreach (var prop in img.PropertyItems) { if (prop.Id == 0x112) { orien = prop.Value[0]; } } switch (orien) { case 2: im

#region 图片旋转 public static void rotating(Bitmap img,ref int width,ref int height) { int ow = width; int orien = 1; foreach (var prop in img.PropertyItems) { if (prop.Id == 0x112) { orien = prop.Value[0]; } } switch (orien) { case 2: img.RotateFlip(RotateFlipType.RotateNoneFlipX);//horizontal flip break; case 3: img.RotateFlip(RotateFlipType.Rotate180FlipNone);//right-top break; case 4: img.RotateFlip(RotateFlipType.RotateNoneFlipY);//vertical flip break; case 5: img.RotateFlip(RotateFlipType.Rotate90FlipX); break; case 6: img.RotateFlip(RotateFlipType.Rotate90FlipNone);//right-top width = height; height = ow; break; case 7: img.RotateFlip(RotateFlipType.Rotate270FlipX); break; case 8: img.RotateFlip(RotateFlipType.Rotate270FlipNone);//left-bottom width = height; height = ow; break; default: break; } } #endregion

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读