private int ConvertColorToRGB(Color col) { return (col.R) | (col.G << 8) | (col.B << 16); }If you are using VB.NET, it still has an RGB function to call or:
Public Function ConvertColorToRGB(col As Color) As Integer
Return CInt(col.R) Or (CInt(col.G) << 8) Or (CInt(col.B) << 16)
End Function