best way to save System.Color?
-
I am using C# with MySQL.. I want to know what's the best way to save the System.Color in mySQL?
-
I am using C# with MySQL.. I want to know what's the best way to save the System.Color in mySQL?
Try saving as argb
color.Red.ToArgb().ToString
or in HEX
color.Red.ToArgb().ToString ( "X8" )
Here [^] is a good example of serializing color. Take a look at the PIEBALDconsult's 2nd reply. Although the original thread is about returning color from webservice but still you could get an idea about it. I loved that post
-
Try saving as argb
color.Red.ToArgb().ToString
or in HEX
color.Red.ToArgb().ToString ( "X8" )
Here [^] is a good example of serializing color. Take a look at the PIEBALDconsult's 2nd reply. Although the original thread is about returning color from webservice but still you could get an idea about it. I loved that post
yeah, I liked that thread too. I would however have preferred System.Color to serialize just like a simple integer all by itself! :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
Try saving as argb
color.Red.ToArgb().ToString
or in HEX
color.Red.ToArgb().ToString ( "X8" )
Here [^] is a good example of serializing color. Take a look at the PIEBALDconsult's 2nd reply. Although the original thread is about returning color from webservice but still you could get an idea about it. I loved that post
Excellent answer! I was about to same the same thing.