画像が表示された WPF ウィンドウがあります。ビデオを再生しているように、画像をすばやく変更したい。すべてのデータがメモリ内にあると仮定すると、ウィンドウにペイントする次の方法よりも高速な方法はありますか。
public void updateCanvas(byte[] imageData, RECT bounds)
{
TypeConverter tc = TypeDescriptor.GetConverter(typeof(Bitmap));
Bitmap bitmap = (Bitmap)tc.ConvertFrom(imageData);
Graphics g = Graphics.FromImage(canvas);
g.DrawImageUnscaled(bitmap, bounds.left, bounds.top);
this.Image.Source = Imaging.CreateBitmapSourceFromHBitmap(canvas.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
this.Image.InvalidateVisual();
}
レンダリングされたバイトデータへのポインタを格納してバイトコピーを行う方法はありますか? または、ウィンドウに描画するより高速な方法 (おそらく DirectX など)?
データが生成されているため、ビデオ ファイルを再生することはできません。
ありがとう!