VB里的颜色怎么算?
vb吧
全部回复
仅看楼主
level 6
5174110120 楼主
假如RGB分别是125,160,110,怎么写,VB颜色上的字母比PS的多三位呀
2008年11月24日 10点11分 1
level 7
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分 2
level 6
5174110120 楼主

2008年11月24日 11点11分 3
1