|
-
May 17th, 2012, 06:52 PM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|