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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top