Is there an easy way, or free library, that will allow you to append small bitmaps into one large bitmap on file? I’m doing a capture of a web page that sometimes is quite large vertically. To avoid OOM exceptions I load small vertical by full horizontal slices of the capture into memory and would like to save those to disk. An append to an open filestream would be great. I’m not an expert on the Bitmap format but I am aware there is probably header / footer information that may prevent this.
Share
There is header information, but it’s a fixed size. You could write the header information and then append rows of pixels, keeping track of the height and other information. When you’re done, position to the front of the file and update the header.
Bitmap File Format is a pretty good description of the format.
I would suggest using the version 3 format unless there’s something you really need from the V4 structure. 24 bits per pixel is the easiest to deal with, since you don’t have to mess with a color palette. 16 and 32 bit color are easier than 4 and 8 bit color (which require a palette).