Hello, I have a method that I call and it returns bitmap data from a capture device.
It returns a pointer to the buffer data as an IntPtr and the buffer length as an int.
I know in advance that this bitmap is a 24bpp and its width and height.
The problem is that the buffer contains the bitmap data upside down and I need this data to be in the right order (reverse it).
What I do is create a for loop and using CopyMemory, I copy each line (stride) of this data from bottom to up to a newly allocated memory space.
Is there any way to make it faster than creating more memory each time I receive a new frame? It makes the application get a bit slow and consumes more memory as each bitmap is pretty big.
I do this because I use another component that analyses the bitmaps and it doesn't work propertly if the bitmaps are upside down.
I'm using .net, c# thanks!