Mit svar, hvar ikke for at nedværdige din viden, men blot for evt. at kunne hjælpe andre der engang ville søge på dit spørgsmål, som ikke ved en kæphest omkring det.
\'----------------------------------------------------------------- \'PURPOSE: Returns red/green/blue color from RGB color value. \'ACCEPTS: RGB color value as Long, and component number as integer \' that represents the component color to return (1=red, \' 2=green, 3=blue). \'RETURNS: The intensity of the color component (0 - 255) as an \' integer or -1 indicating that an argument was invalid. \'----------------------------------------------------------------- Function GetRGB (RGBval As Long, Num As Integer) As Integer \' Check if Num, RGBval are valid. If Num > 0 And Num < 4 And RGBval > -1 And RGBval < 16777216 Then GetRGB = RGBval \\ 256 ^ (Num - 1) And 255 Else \' Return True (-1) if Num or RGBval are invalid. GetRGB = True End If End Function
MsgBox GetRGB(16384, 1) MsgBox GetRGB(16384, 2) MsgBox GetRGB(16384, 3) Giver 3 messageboxe, med værdierne 0, 64 og 0 hvilker svarer til en \'meget mørkegrøn\' farve
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.