level 6
VB使用的颜色值是16进制的。下面的代码可以把RGB值转换成网页使用的颜色。Public Fun百度ction to16Hex(R As Integer, G As Integer, B As Integer) As String Dim hex_r As String, hex_g As String, hex_b As String hex_r = Hex$(R) hex_g = Hex$(G) hex_b = Hex$(B) If Len(hex_r) = 1 Then hex_r = "0" & hex_r If Len(hex_g) = 1 Then hex_g = "0" & hex_g If Len(hex_b) = 1 Then hex_b = "0" & hex_b hex_rgb = hex_r & hex_g & hex_b to16Hex = "#" & hex_rgbEnd Fun百度ction
2008年11月24日 11点11分