You need to convert the unmanaged pointer to a managed array of bytes:
Marshal.Copy[
^] is what you need. But first, you need to find the size of the image buffer that the IntPtr points to, and allocate a big enough byte[]. Without your code, I can't tell you how to get that! :laugh: