简体   繁体   中英

Cannot open bitmap files

I have a problem with opening bitmap files(widthxheight) in windows. Files are generated by a Java program which reads .dat files by 4bytes and write them as .bmp files. The weird thing is, if the width of the file is multiple of 4, the file can be opened (ie 400x450). However, if its not, I cant open the file and it says drawing failed (ie 450x400).

Any idea why this is happening? Thanks a lot.

BMP lines are padded to 4 bytes. Please make sure on write also on read to take care of that, see on net, wikipedia about BMP format.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM