Created
February 4, 2015 06:26
-
-
Save veigr/fad744b9c7ddf5738722 to your computer and use it in GitHub Desktop.
[WinRT][SharpDX]変換結果の描写
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 変換結果の描写 | |
var stride = transform.Size.Width * 4; //横1行のバイト数 | |
var size = stride * transform.Size.Height; | |
var bytes = new byte[size]; | |
transform.CopyPixels(bytes, stride); | |
// SharpDX.WIC.BitmapSourceをWritableBitmapに変換 | |
var bitmap = new WriteableBitmap(transform.Size.Width, transform.Size.Height); | |
using (var s = bitmap.PixelBuffer.AsStream()) | |
{ | |
await s.WriteAsync(bytes, 0, size); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment