You are using a relative path to the file. It seems quite possible you are writing to one file called abc.bmp and reading from another.