2014-11-05 89 views
0

問題: 我以90度逆時針旋轉1次風景圖像1次。重建圖像後,它看起來並沒有看到它在逆時針位置旋轉了1次。它提供順時針90度的圖像。如何在逆時針旋轉後重建圖像

我用下面的代碼:

 
var encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.PngEncoderId, fileStream); 

    encoder.SetPixelData(
    BitmapPixelFormat.Bgra8, 
    BitmapAlphaMode.Ignore, 
    (uint)renderTargetBitmap.PixelWidth, 
    (uint)renderTargetBitmap.PixelHeight, 
    DisplayInformation.GetForCurrentView().LogicalDpi, 
    DisplayInformation.GetForCurrentView().LogicalDpi, 
    pixelBuffer.ToArray()); 

    encoder.BitmapTransform.Rotation = BitmapRotation.Clockwise90Degrees; 

    await encoder.FlushAsync(); 

There is no AntiClockwise90Degrees in BitmapRotation 

如何解決這個問題呢?

回答

0

BitmapRotation.Clockwise90Degrees將順時針旋轉90°。 BitmapRotation.Clockwise270Degrees將逆時針旋轉90°(360° - 90°= 270°)

相關問題