Results 1 to 9 of 9

Thread: Get Pixel from window and click if that pixel (or in range of that pixels) exists.

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2020
    Posts
    4

    Post Get Pixel from window and click if that pixel (or in range of that pixels) exists.

    Hello VB Forums!

    I'm trying to accomplish a new project for myself which is giving me headaches.
    So, I want to:
    - Get/Focus a window (done)
    - Detect pixel (done)
    - Mouse inputs (done)
    - Now the fun part, I want to check if Pixels eg. (55, 80, 120) are found in that window, click it, also, if other pixels are relative to (55, 80, 120) click it also.

    Thanks, hope someone could help me.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,919

    Re: Get Pixel from window and click if that pixel (or in range of that pixels) exists

    Google VB.Net MouseEvent API

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    36,084

    Re: Get Pixel from window and click if that pixel (or in range of that pixels) exists

    Are those colors that you are wanting to click on? 55, 80, 120 looks like an RGB color. If it's a color, what does relative mean? It's fairly unlikely that there's just ONE pixel of a certain color, and you likely don't want to be clicking on a second pixel that is adjacent to the first.
    My usual boring signature: Nothing

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,919

    Re: Get Pixel from window and click if that pixel (or in range of that pixels) exists

    Quote Originally Posted by Shaggy Hiker View Post
    Are those colors that you are wanting to click on? 55, 80, 120 looks like an RGB color. If it's a color, what does relative mean? It's fairly unlikely that there's just ONE pixel of a certain color, and you likely don't want to be clicking on a second pixel that is adjacent to the first.
    I think the OP wants to keep clicking at random points within a region defined by a color. Ive seen these type of questions before, where the OP thinks clicking at different points will appear more of a human interaction with the app.

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2020
    Posts
    4

    Re: Get Pixel from window and click if that pixel (or in range of that pixels) exists

    Quote Originally Posted by Shaggy Hiker View Post
    Are those colors that you are wanting to click on? 55, 80, 120 looks like an RGB color. If it's a color, what does relative mean? It's fairly unlikely that there's just ONE pixel of a certain color, and you likely don't want to be clicking on a second pixel that is adjacent to the first.
    Yes, that's a RGB color, if pixels are relative >> should be like eg. 10, so be like this <=> 55, 80, 120

    Eg. -1: >> 54, 79, 119
    +1: >> 56, 81, 121

    Up to N value or tolerance or how do you want to call it...

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    36,084

    Re: Get Pixel from window and click if that pixel (or in range of that pixels) exists

    That's a pretty ambitious goal. Colors are vague and images are large, so this type of thing is usually a pretty bad idea. What are you hoping to achieve with it?
    My usual boring signature: Nothing

  7. #7

    Thread Starter
    New Member
    Join Date
    Dec 2020
    Posts
    4

    Re: Get Pixel from window and click if that pixel (or in range of that pixels) exists

    Quote Originally Posted by Shaggy Hiker View Post
    That's a pretty ambitious goal. Colors are vague and images are large, so this type of thing is usually a pretty bad idea. What are you hoping to achieve with it?
    I'd like to make a bot... Would you suggest me anything else?

  8. #8
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,919

    Re: Get Pixel from window and click if that pixel (or in range of that pixels) exists

    Quote Originally Posted by piticu97 View Post
    Hello VB Forums!

    I'm trying to accomplish a new project for myself which is giving me headaches.
    So, I want to:
    - Get/Focus a window (done)
    - Detect pixel (done)
    - Mouse inputs (done)
    - Now the fun part, I want to check if Pixels eg. (55, 80, 120) are found in that window, click it, also, if other pixels are relative to (55, 80, 120) click it also.

    Thanks, hope someone could help me.

    Detect pixel (done)
    So what's the problem???

  9. #9
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,919

    Re: Get Pixel from window and click if that pixel (or in range of that pixels) exists

    As Shaggy Hiker told you... It's unlikely you'll find a block of rgb(55, 80, 120) colored pixels. Actual colors are vague.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width