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

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

Thread Options How can I find the 32 bit number of a color?
  1. Unread #1 - Sep 6, 2011 at 11:51 PM
  2. dgameman1
    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0

    dgameman1 Active Member
    Banned

    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?
     
  3. Unread #2 - Sep 7, 2011 at 5:01 AM
  4. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    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])
    
     
  5. Unread #3 - Sep 7, 2011 at 10:37 PM
  6. dgameman1
    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0

    dgameman1 Active Member
    Banned

    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 =/
     
  7. Unread #4 - Sep 7, 2011 at 10:49 PM
  8. dgameman1
    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0

    dgameman1 Active Member
    Banned

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

  9. Unread #5 - Sep 8, 2011 at 5:05 AM
  10. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    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.
     
  11. Unread #6 - Sep 8, 2011 at 5:32 AM
  12. Terrankiller
    Joined:
    May 7, 2005
    Posts:
    1,286
    Referrals:
    1
    Sythe Gold:
    1

    Terrankiller Ex-Administrator
    Retired Administrator Visual Basic Programmers

    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)
    
     
  13. Unread #7 - Sep 8, 2011 at 7:02 AM
  14. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

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

    haha i always forget how handy .net is compared to 6
     
  15. Unread #8 - Sep 8, 2011 at 7:41 AM
  16. Terrankiller
    Joined:
    May 7, 2005
    Posts:
    1,286
    Referrals:
    1
    Sythe Gold:
    1

    Terrankiller Ex-Administrator
    Retired Administrator Visual Basic Programmers

    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.
     
  17. Unread #9 - Sep 8, 2011 at 10:26 AM
  18. dgameman1
    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0

    dgameman1 Active Member
    Banned

    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.
     
  19. Unread #10 - Sep 9, 2011 at 6:20 AM
  20. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    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.
     
  21. Unread #11 - Sep 9, 2011 at 10:23 AM
  22. dgameman1
    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0

    dgameman1 Active Member
    Banned

    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? >

Users viewing this thread
1 guest


 
 
Adblock breaks this site