File - Getting RGB values for each pixel from a 24bpp Bitmap in C. Bitmap Manipulating Code in C. I am taking a beginners programming course and we have to manipulate a Bitmap image with code in C.
Currently I am trying to create a function which reads the Bitmap file, and stores the contents (Width,Height,Palette Info, and Pixel Data) into structs, so that it can be accessed by other functions. I think I've managed to do an okay job at extracting data, but I am having trouble storing it into the structs. When I access the struct by another simple function it just gives me 0 as the height and width, but I can't find what is wrong with my code. I would really appreciate it if anyone could help me figure out how to do this, because I don't think I did the malloc right, which is why I can't access the struct. C/C++ - Loading Bitmap Files (Manually) [Archive]
Nick Chadwick's Blog.