Alternative use for Color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ever needed to get byte values from an integer?

just convert the integer to a color using Color.FromARGB and then use the
A,R,G,B properties

and to do the reverse use Color.FromARGB(A,R,G,B)

It is undoubtedly bad practice but it makes things easy!

guy
 
guy said:
Ever needed to get byte values from an integer?

just convert the integer to a color using Color.FromARGB and then use the
A,R,G,B properties

and to do the reverse use Color.FromARGB(A,R,G,B)

It is undoubtedly bad practice but it makes things easy!

guy

Err, thanks for the tip, but it's a little obscure.

I can't imagine what the maintenance coder would say in five years time when
he's tweaking my code and comes across something like that. I'll stick with
the bitconvertor.
 
Back
Top