Memcpy in reverse order


I have bitmap in memory and using that to write to utexture2d:

FMemory::Memcpy(MipData, bitmap, BmpSize);

that give me a inverted image.

I read i must do that in reverse.
What its the easy/fast way for copy in reverse in UE?

I still reading ways to do that but perhaps in UE there something more for use.

BMP files do not store bytes in reverse order. They store lines of image in reverse order. You can still use Memcpy for single line of image, but you should reverse order of reading of those lines(start reading from end).

yep thanks i read that but i read this its a lot of slow that because i ask for something for doing that fast, but i resolve the problem.

I can modified that before store in memory adding “-” in the header

< bi.biHeight = bmp.bmHeight;

bi.biHeight = - bmp.bmHeight;

And that solve the problem, i can use normally memcpy .

Nothing like ask for help for found the answer by oneself lol