Storing color information?

Discussion in 'Questions (Windows Mobile)' started by N1c0_ds, Jan 7, 2009.

  1. N1c0_ds

    N1c0_ds Active Member Licensed User

    Is there a way to store a color as a variable? I want to save color information in a text file and then set it to a control at launch.

    Any idea on how I could do that?
     
  2. klaus

    klaus Expert Licensed User

    No problem:

    For example:
    Col=Button1.Color

    in the Save routine
    FileWrite(c1,Col)

    in the Load routine
    Col=FileRead(c1)

    Panel1.Color=Col

    Best regards.
     
  3. N1c0_ds

    N1c0_ds Active Member Licensed User

    This works perfect, thanks!
     
  4. derez

    derez Expert Licensed User

    Getting the color coordinates

    Is there a way to get by code the color coordinates (R,G,B) of a color which is defined as a single (color) variable ?

    for example - how do you know the RGB of cYellow ?

    thanks
     
  5. agraham

    agraham Expert Licensed User

    Help->MainHelp->Keywords->General
    Code:
    Sub Globals
          
    Dim Type (R,G,B) clr
    End Sub


    Sub App_Start
          Form1.Show
          clr() = GetRGB(Form1.Color)
          
    Msgbox("Red=" & clr.R & " Green=" & clr.G & " Blue=" & clr.B)
    End Sub
     
  6. derez

    derez Expert Licensed User

    Thank you :)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice