colors in database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jassim Rahma

    #1

    colors in database

    what's the best way to store and retrieve colors from a database? string or
    RGB values or...

  • John B

    #2
    Re: colors in database

    Jassim Rahma wrote:
    what's the best way to store and retrieve colors from a database? string
    or RGB values or...
    Depends which colours.
    If it's going to be only known colours such as Color.Red,
    Color.SteelBlue then you could store the name and use Color.FromName to
    re-create.
    Otherwise you could store the [A]RGB values either separately or
    combined and use Color.FromArgb to re-create.
    Basically, the _best_ way, is the way that works for you :)

    HTH
    JB

    Comment

    • Kevin Spencer

      #3
      Re: colors in database

      Use the System.Drawing. Color.ToArgb() method to get the integer value of
      your color as a single value, and store that in the database. You can then
      use the System.Drawing. Color.FromArgb( Int32) method in your app to get the
      color from the integer.

      --
      HTH,

      Kevin Spencer
      Microsoft MVP

      DSI PrintManager, Miradyne Component Libraries:


      "Jassim Rahma" <jrahma@hotmail .comwrote in message
      news:96132BD7-EC20-4C6E-8B40-D921CCFA7753@mi crosoft.com...
      what's the best way to store and retrieve colors from a database? string
      or RGB values or...

      Comment

      Working...