C#图片处理之:旋转图片90度的整数倍
2017-10-25 09:57
369 查看
原文:C#图片处理之:旋转图片90度的整数倍
旋转图片90的整数倍那真是太简单了。
public static Bitmap KiRotate90(Bitmap img)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
try
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return img;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
catch
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return null;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
旋转图片90的整数倍那真是太简单了。
public static Bitmap KiRotate90(Bitmap img)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
try
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return img;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
catch
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return null;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
namespace System.Drawing { // // 摘要: // 指定多少图像的旋转和翻转图像所用于的轴。 public enum RotateFlipType { // // 摘要: // 指定没有顺时针旋转和翻转。 RotateNoneFlipNone = 0, // // 摘要: // 指定后接水平和垂直的 180 度顺时针旋转翻转。 Rotate180FlipXY = 0, // // 摘要: // 指定不进行翻转顺时针旋转 90 度。 Rotate90FlipNone = 1, // // 摘要: // 指定后接水平和垂直的 270 度顺时针旋转翻转。 Rotate270FlipXY = 1, // // 摘要: // 指定不进行翻转 180 度的顺时针旋转。 Rotate180FlipNone = 2, // // 摘要: // 指定没有顺时针旋转后接水平和垂直翻转。 RotateNoneFlipXY = 2, // // 摘要: // 指定不进行翻转顺时针旋转 270 度。 Rotate270FlipNone = 3, // // 摘要: // 指定旋转 90 度顺时针旋转后接水平和垂直翻转。 Rotate90FlipXY = 3, // // 摘要: // 指定没有跟水平翻转的顺时针旋转。 RotateNoneFlipX = 4, // // 摘要: // 指定垂直翻转后跟 180 度顺时针旋转。 Rotate180FlipY = 4, // // 摘要: // 指定后接水平翻转的 90 度的顺时针旋转。 Rotate90FlipX = 5, // // 摘要: // 指定垂直翻转后跟的 270 度顺时针旋转。 Rotate270FlipY = 5, // // 摘要: // 指定后接水平翻转的 180 度顺时针旋转。 Rotate180FlipX = 6, // // 摘要: // 指定垂直翻转后跟没有顺时针旋转。 RotateNoneFlipY = 6, // // 摘要: // 指定后接水平翻转的 270 度顺时针旋转。 Rotate270FlipX = 7, // // 摘要: // 指定垂直翻转后跟 90 度顺时针旋转。 Rotate90FlipY = 7 } }
相关文章推荐
- C#图片处理之:旋转图片90度的整数倍 .
- C#图片处理之:旋转图片90度的整数倍
- C#图片处理之:旋转图片90度的整数倍
- C#图片处理之:旋转图片90度的整数倍
- C#图片处理之:旋转图片90度的整数倍
- C#图片处理之:旋转图片90度的整数倍
- 使用.net(C#)处理图片之:旋转图片任意角度
- C# 图片处理之:旋转图片任意角度
- C# 图片处理之:旋转图片任意角度 .
- H5技术完美实现调用手机摄像头、相册。图片上传base64,图片压缩、预览、删除以及图片旋转90度的处理--demo。
- C# 图片处理之:旋转图片任意角度
- C#中基于GDI+(Graphics)图像处理系列之文字或者图片水印(透明、任意角度旋转)
- C#图像处理(各种旋转、改变大小、柔化、锐化、雾化、底片、浮雕、黑白、滤镜效果,滤波,图像截取) 对图片的处理 : 亮度调整 抓屏 翻转 随鼠标画矩形
- C# 图片处理之:旋转图片任意角度
- 关于android中调用系统拍照,返回图片是旋转90度的处理
- 关于部分android手机连拍模式,手机拍照上传的图片旋转了90度的c#解决方案
- Android Camera拍照预览图片90度旋转
- php旋转图片90度的方法
- 最全的C#图片处理帮助类ImageHelper
- PHP图片处理之图片旋转和图片翻转