bos.write4Bytes(width); // width
bos.write4Bytes(height); // height
bos.write2Bytes(1); // Number of Planes
bos.write2Bytes(writer.getBitsPerPixel()); // Bits Per Pixel
bos.write4Bytes(BI_RGB); // Compression
bos.write4Bytes(imagedata.length); // Bitmap Data Size
bos.write4Bytes(pixelDensity != null ? (int) Math
.round(pixelDensity.horizontalDensityMetres()) : 0); // HResolution
bos.write4Bytes(pixelDensity != null ? (int) Math
.round(pixelDensity.verticalDensityMetres()) : 0); // VResolution