Adblock breaks this site

Thread Options How can I find the 32 bit number of a color?

Discussion in 'Programming General' started by dgameman1, Sep 6, 2011.

  1. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    Thread Options How can I find the 32 bit number of a color?

    For example, black is 0, how can I find out what number other colors are?
     
  2. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    Thread Options How can I find the 32 bit number of a color?

    Code:
    msgbox(color.black.toargb.tostring)
    then to use the 32bit colour, do;
    Code:
    me.backcolor = color.fromargb([COLOUR_HERE])
    
     
  3. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    Thread Options How can I find the 32 bit number of a color?

    Why am I so goddamn retarded. I don't know what to do. I just want there to be a msgbox saying what number a color my mouse is on =/
     
  4. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    Thread Options How can I find the 32 bit number of a color?

  5. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    Thread Options How can I find the 32 bit number of a color?

    You will need to use the GetCursorPos API then you will need to use the GetPixel API, I'd do it for you but i don't have VS installed on this computer anymore, i could try coding it off the top of my head but it will be strung full of silly syntax errors and would only confuse you further :(.

    What are you trying to do exactly, because i may have a working source i can just upload for ya to look at, learn from or use etc.
     
  6. Terrankiller

    Terrankiller Ex-Administrator
    Retired Administrator Visual Basic Programmers

    Joined:
    May 7, 2005
    Posts:
    1,286
    Referrals:
    1
    Sythe Gold:
    1
    Thread Options How can I find the 32 bit number of a color?

    Code:
    Dim hDC As IntPtr
    hDC = GetWindowDC(0)
    MsgBox(GetPixel(hDC, Cursor.Position.X, Cursor.Position.Y).ToString)
    ReleaseDC(0, hDC)
    
     
  7. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    Thread Options How can I find the 32 bit number of a color?

    haha i always forget how handy .net is compared to 6
     
  8. Terrankiller

    Terrankiller Ex-Administrator
    Retired Administrator Visual Basic Programmers

    Joined:
    May 7, 2005
    Posts:
    1,286
    Referrals:
    1
    Sythe Gold:
    1
    Thread Options How can I find the 32 bit number of a color?

    Yeah I do not know much about .net yet I have only been using .net for like a week or two.
     
  9. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    Thread Options How can I find the 32 bit number of a color?

    Well, what I am trying to do is load a flash game in the webbrowser.
    Then I want it so that when I press button1 for example, it would look for a certain color, in a certain spot, then click it, then when it is done, it would continue to look for a another color, in another certain spot, and then click it and so on.
     
  10. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    Thread Options How can I find the 32 bit number of a color?

    Link me to the game and i'll have a look, i'm pretty bored right now so i might convert some vb6 code over and make half the project for you.
     
  11. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    Thread Options How can I find the 32 bit number of a color?

    Thank you so much to be willing to do that, but I don't want to bother you =P
     
< Can VB.net Click colors? | Thread Options How can I enable flash in WebBrowser? >


 
 
Adblock breaks this site