2010-05-31 3 views
1

J'essaie d'utiliser System.Drawing.RotateFlipType dans mon fichier de paramètres. Cette capture d'écran résume mon problème:RotateFlipType de mauvaises valeurs lorsqu'il est utilisé dans les paramètres

alt text http://l-2.incito.hr/rotatefliptype.png

Chacune des valeurs RotateFlipType est doublé, et certains sont manquants. Si j'essaie d'utiliser certaines valeurs manquantes (comme Rotate180FlipX, via app.config), il est simplement ignoré.

En utilisant VS2008 avec SP1, vb.net avec Framework 3.5 sur Windows 7.

Répondre

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, 
} 

Prenez un papier et essayer de retourner & tourner et vous verrez que les valeurs en double sont en effet double, à savoir. ils représentent la même transformation. Convertisseur Enum va évidemment de 0 à 7, recherche enum string et obtient FIRST pour vous.

Questions connexes