Quantcast
Channel: DaniWeb Solved Topics
Viewing all articles
Browse latest Browse all 564

VB6: how combine ARGB color elements?

$
0
0

i have tried several ways, but i always get an overflow error :(
how can i combine the ARGB color elements?

Public Function ARGB(ByVal alpha As Byte, ByVal red As Byte, ByVal green As Byte, ByVal blue As Byte) As Long


    Dim color As Variant

    color = CDec(alpha) * 256 ' Alpha
    color = (color * 256) + CDec(red) ' Red
    color = (color * 256) + CDec(green) ' Green
    color = CDec((color * 256) + CDec(blue)) ' Blue 

    ARGB = CDec(color) 'overflow error
End Function

Viewing all articles
Browse latest Browse all 564

Trending Articles