You have to read the bitmap header first. After got to the data offset which you will find in the bitmap headers and read the pixels line by line, make care about the padding in bmp file format.
take a look on msdn
http://msdn.microsoft.com/en-us/library/aa452883.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/dd318229(v=vs.85).aspx