現在、System.Drawing.Bitmap
をWPF WriteableBitmap
に統合する際にいくつか問題があります。System.Drawing.BitmapをWriteableBitmapの領域にコピー
からWriteableBitmap
の位置(X、Y)にコピーしたいと思います。
次のコードは、これをどうしようとしたかを示しています。
BitmapData Data = Bitmap.LockBits(new Rectangle(0, 0, Bitmap.Width, Bitmap.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
WriteableBitmap.Lock();
//CopyMemory(WriteableBitmap.BackBuffer, Data.Scan0, ImageBufferSize);
Int32Rect Rect = new Int32Rect(X, Y, Bitmap.Width, Bitmap.Height);
WriteableBitmap.AddDirtyRect(Rect);
Bitmap.UnlockBits(Data);
Bitmap.Dispose();`
どうもありがとう、
Neokript