Very nice.
The BMPRGB (and UnBMPRGB) functions are here:
Sub BMPRGB(RGBColor As Long, redvalue As Long, greenvalue As Long, bluevalue As Long)
' Convert RGB to 24 bit color
ierror = False
On Error GoTo BMPRGBError
RGBColor& = RGB(CInt(redvalue&), CInt(greenvalue&), CInt(bluevalue&))
Exit Sub
' Errors
BMPRGBError:
MsgBox Error$, vbOKOnly + vbCritical, "BMPRGB"
ierror = True
Exit Sub
End Sub
Sub BMPUnRGB(RGBColor As Long, redvalue As Long, greenvalue As Long, bluevalue As Long)
' Convert 24 bit color to RGB
ierror = False
On Error GoTo BMPUnRGBError
' RGBcolor = Format(Hex(redvalue&) & Hex(greenvalue&) & Hex(bluevalue&), "000000")
redvalue& = (RGBColor& And &HFF&)
greenvalue& = (RGBColor& And &HFF00&) \ 256 ' this is correct appraently
bluevalue& = (RGBColor& And &HFF0000) \ 65536 ' this is correct apparently
Exit Sub
' Errors
BMPUnRGBError:
MsgBox Error$, vbOK + vbCritical, "BMPUnRGB"
ierror = True
Exit Sub
End Sub
These functions just convert RGB values to 24 bit color values (and back again).