Results 1 to 11 of 11

Thread: Find an image on screen

Threaded View

  1. #7
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Find an image on screen

    For 2D, some steps:

    1) Determine your representative pixels, store color, x pos and y pos for each and store them somewhere, an array for example.
    2) Take an screenshot as bitmap using something like this
    3) Use Fastpix (submitted by boops boops to the Codebank) for fast pixel processing. With this you'll create a loop checking each pixel in the screenshot bitmap, when you find the first see if the second is also in position and so on, if you find all of them then you found your bitmap, if not then continue looping.

    Assume your 1st representative pixel is at X=40+xOffset and Y=20+YOffset, then you know that moving 40 towards LEFT and 20 towards TOP you'll find the first point (top-left corner) for your image found in the screen, and if you need the center it will be:

    X = X0 + YourImageWidth / 2
    Y = Y0 + YourImageHeight / 2
    Last edited by jcis; May 17th, 2012 at 07:02 PM.

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