Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8429909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:27:58+00:00 2026-06-10T05:27:58+00:00

Currently I use this to find a bitmap that occurs in another image on

  • 0

Currently I use this to find a bitmap that occurs in another image on the screen i.e. a window but it is tool slow, i want it to take 1 or less seconds, I was thinking of cropping the image into a section i.e. a 80,60 section at point 0,0 of the image and searching there, when it has done that it do the same crop but y+60 and continue until it has covered the full image assuming it is 800 by 600 pixel

the code i currently use is:

        public bool findImage(Bitmap small, Bitmap large, out Point location)
    {
        //Loop through large images width
        for (int largeX = 0; largeX < large.Width; largeX++)
        {
            //And height
            for (int largeY = 0; largeY < large.Height; largeY++)
            {
                //Loop through the small width
                for (int smallX = 0; smallX < small.Width; smallX++)
                {
                    //And height
                    for (int smallY = 0; smallY < small.Height; smallY++)
                    {
                        //Get current pixels for both image
                        Color currentSmall = small.GetPixel(smallX, smallY);
                        Color currentLarge = large.GetPixel(largeX + smallX, largeY + smallY);
                        //If they dont match (i.e. the image is not there)

                        if (!colorsMatch(currentSmall, currentLarge))
                            //Goto the next pixel in the large image

                            goto nextLoop;
                    }
                }
                //If all the pixels match up, then return true and change Point location to the top left co-ordinates where it was found
                location = new Point(largeX, largeY);
                return true;
            //Go to next pixel on large image
            nextLoop:
                continue;
            }
        }
        //Return false if image is not found, and set an empty point
        location = Point.Empty;
        return false;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:27:59+00:00Added an answer on June 10, 2026 at 5:27 am

    Since you are looking for an exact match you can downsample your large picture, and downsample your small picture (but several times, at different offsets). Then search for an exact match of the downsampled pictures (potentially recursing).

    Your large picture does not sound that large, you may be able to get away with doing a Boyer-Moore search for one of the lines.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently use this code to find gcd and lcm def gcd(a, b): while
I currently use the Android Monkey tool for stress testing Android system/packages. I find
Now I've got this fragment which i want to use setContentView with but so
I am currently trying to use this gem http://github.com/pengwynn/linkedin . Everything works fine (i.e.
This is the code I currently use: <% Uri MyUrl = Request.UrlReferrer; if( MyUrl
I currently use, base64_encode() to encode a user's password, this works well because it
Basically, this is what I currently use in an included file: $sites[0]['url'] = http://example0.com;
I'm a beginner coder in Ruby and currently I'm trying to use this plugin:
I have a working website, where I use this expression everywhere. price.ToString(C) It currently
This concerns the state of Struts2 framework tooling, although currently I use no IDE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.