我正在尝试在我的设置文件中使用System.Drawing.RotateFlipType。此屏幕截图总结了我的问题:
alt text http://l-2.incito.hr/rotatefliptype.png
每个RotateFlipType值都加倍,有些值丢失。如果我尝试使用一些缺失值(如Rotate180FlipX,通过app.config) - 它会被忽略。
在Windows 7上使用VS2008 SP1,vb.net和框架3.5。
答案 0 :(得分:3)
// Summary:
// Specifies the direction of an image's rotation and the axis used to flip
// the image.
public enum RotateFlipType
{
// Summary:
// Specifies a 180-degree rotation followed by a horizontal and vertical flip.
Rotate180FlipXY = 0,
//
// Summary:
// Specifies no rotation and no flipping.
RotateNoneFlipNone = 0,
//
// Summary:
// Specifies a 270-degree rotation followed by a horizontal and vertical flip.
Rotate270FlipXY = 1,
//
// Summary:
// Specifies a 90-degree rotation without flipping.
Rotate90FlipNone = 1,
//
// Summary:
// Specifies a 180-degree rotation without flipping.
Rotate180FlipNone = 2,
//
// Summary:
// Specifies no rotation followed by a horizontal and vertical flip.
RotateNoneFlipXY = 2,
//
// Summary:
// Specifies a 270-degree rotation without flipping.
Rotate270FlipNone = 3,
//
// Summary:
// Specifies a 90-degree rotation followed by a horizontal and vertical flip.
Rotate90FlipXY = 3,
//
// Summary:
// Specifies a 180-degree rotation followed by a vertical flip.
Rotate180FlipY = 4,
//
// Summary:
// Specifies no rotation followed by a horizontal flip.
RotateNoneFlipX = 4,
//
// Summary:
// Specifies a 90-degree rotation followed by a horizontal flip.
Rotate90FlipX = 5,
//
// Summary:
// Specifies a 270-degree rotation followed by a vertical flip.
Rotate270FlipY = 5,
//
// Summary:
// Specifies no rotation followed by a vertical flip.
RotateNoneFlipY = 6,
//
// Summary:
// Specifies a 180-degree rotation followed by a horizontal flip.
Rotate180FlipX = 6,
//
// Summary:
// Specifies a 90-degree rotation followed by a vertical flip.
Rotate90FlipY = 7,
//
// Summary:
// Specifies a 270-degree rotation followed by a horizontal flip.
Rotate270FlipX = 7,
}
拿一张纸,试着翻转并旋转它,你会发现重复的值确实是重复的,即。它们代表着同样的转变。枚举转换器显然从0到7,搜索枚举字符串并为您获取FIRST。