public void CopyPixels([In] ref WICRect prc, [In] uint uiWidth, [In] uint uiHeight, Guid dstFormat, [In] WICBitmapTransformOptions dstTransform, [In] uint nStride, [In] uint cbBufferSize, byte[] pbBuffer) { try { Log.Trace($"Trans CopyPixels called"); Log.Trace($"Trans CopyPixels called: {uiWidth}, {uiHeight} {dstFormat}"); if (dstFormat == GUID_WICPixelFormat32bppBGRA) { CopyBGRA(ref prc, nStride, cbBufferSize, pbBuffer); } if (prc.Y + prc.Height == rgbmap.Height) { rgbmap.Dispose(); } Log.Trace("CopyPixels finished"); } catch (Exception e) { Log.Error("CopyPixels failed: " + e); throw; } }