Hi there
I think the code below should do what you're trying to do. You simply need to define X & Y as the offset position:
int stride = source.PixelWidth * (source.Format.BitsPerPixel / 8);
byte[] data = new byte[stride * source.PixelHeight];
source.CopyPixels(data, stride, 0);
WriteableBitmap target = new WriteableBitmap(
source.PixelWidth,
source.PixelHeight,
source.DpiX, source.DpiY,
source.Format, null);
target.WritePixels(
new Int32Rect(X, Y, source.PixelWidth, source.PixelHeight),
data, stride, 0);
targetImage.Source = target;
Regards,
Pedro
If you find my post helpful, please remember to "Mark As Answer" and/or "Vote as Helpful"