Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to extract the components of ARGB color in VB?
How to extract the components of ARGB color in VB?
The format of rgb value is (16 hexadecimal): 0x00bbggrr.

1. Extract rgb score:

Function RGB bit (byvalrgb &; , blue%, green%, red%)

Blue = ((RGB and & amphff0000) \&; H 10000)

Green = ((RGB and & ampHFF00 & amp)\ & ampH 100)

Red = (RGB and & ampHFF & amp; )

End function

Calling method: define three variables r, g, b integer, and call RGB bit (13870724, r, g, b).

2. Get RGB values from three colors

The function RevRGB (blue%, green%, red%) is the same length.

rev RGB =(blue * & amp; H 10000)+(green *&100. )+red

End function