Trouble writing a to a bitmap

Hiya, having a bit of trouble dumping the screen to a project.

Iv written a method that writes bmp files and i have tested. When i read the pixels from my screen however, my bitmap looks like this:

I understand that bitmaps have the Red and Blue inversed, so i simply changed the order which i write out the red and blue and my program outputs this:

It’s probably just an error in my coding - but i just thought Id take a long shot and post here to see if anyone else had had the same problem.

Thanks,

Nick.

Problem now solved!

…dont ask

Looks like missing padding bytes, right?