What you'll need to know then is the formats of the bitmap file and the Dicom file. Then you would create a program that reads the bitmap (either in full or one or more bytes at a time), decides what each byte means, then writes out to the Dicom file the same information, but in the new format. You may need to store some data in memory in order to write out the new file correctly - it depends on the file formats and how you decide to perform the conversion.

Found a couple of possibly useful references (Googled "BMP file format" for the first):