So, I guess we can break down the issue in two part:
1) how to normalise the float value into gary value in integer
2) how to use this values in a particular image format
The first one is not too hard.
Set a scale of gary value says 0 - 255
then find the lowest and highest float value in the array and then
res = (float value - lowest)/(highest - lowest) * (255)
Then you have to know about the target image format. Since I use Qt, so QImage can be used as an example. (
http://doc.trolltech.com/3.3/qimage.html) But afterall you must choose which format you wanna use.
Unfortunately I have to step out now, so let's see how far you got when I'm back.