Just a dead simple, one file, C++ bmp write routine. Only 24-bit support, contains Bresenham's line algorithm.
Requires only standard libraries, compiles atleast on g++
Test code draws a red line across the bitmap and writes it on disk.
Contains code snippets around the internets.