Case "D" NumOfPart = ( NumOfPart + 13 ) * 16 Case "E" NumOfPart = ( NumOfPart + 14 ) * 16 Case "F" NumOfPart = ( NumOfPart + 15 ) * 16 Case Else NumOfPart = ( NumOfPart + CInt( MyByte ) ) * 16 End Select Next //上面多乘了16,要去掉 NumOfPart = NumOfPart / 16 // Red + Green*256 + Blue*65536 Select Case PartOfRGB Case 1 NumOfPart = NumOfPart - 65536 * Fix( NumOfPart/65536 ) //去掉Blue色 NumOfPart = NumOfPart - 256 * Fix( NumOfPart/256 ) //去掉Green色 Case 2 NumOfPart = NumOfPart - 65536 * Fix( NumOfPart/65536 ) //去掉Blue色 NumOfPart = Fix( NumOfPart/256 ) //得到Green色 Case Else NumOfPart = Fix( NumOfPart/65536 ) //得到Blue色 End Select PartNumOfRGB = NumOfPart Rem EndOfGetRedOfRGB End Function