On 21-02-19 17:10, Vincent Povirk wrote:
Image buffers passed into Bitmap constructors such as GdipCreateBitmapFromScan0 are referenced by the Bitmap object and must be valid for the Bitmap's lifetime.
I had the free at the bottom of the function first, but then no tests failed when I moved it to the top, so I left it there instead. I'll move it back to the bottom.