title: Finding the bitmap in bigger bitmap (Pixel bot) - How to make it/for loops faster?
body: <p>so this function is finding a bitmap in bigger bitmap.. buuuut .. it takes like 4-6s to go through 1920x1080 screen..
  I wouldn't be asking you if I 100% understood to that code, which I dont, I am a newbie in programming and my logic is kinda sleeping already (4:00 AM).. (Code is from video tutorial, i was using it for a long time without even studying it :D)</p>
  
  <p>So what do I exactly want is to make a bot finding pixels/pictures in the game and then clicking it, but 4-6s is pretty long, aint it ? I was pretty curious about this, because pixel bots for several games made in other programming languages are pretty, pretty fast ! Like 1s...
  So I was like, its caused by c# ? It probably aint caused by c# .. but this code is proly working, but maybe it doesnt need to be that long ? 
  I thought about "getting faster loops" .. but thats aint happening probably.</p>
  
  <p>Try to invent some solution, I will be very grateful ! And I still think that this problem might be important to solve for many other people.</p>
  
  <pre><code>private bool FindBitmap(Bitmap bmpNeedle, Bitmap bmpHaystack, out Point location)
  {
      for (int outerX = 0; outerX &lt; bmpHaystack.Width - bmpNeedle.Width; outerX++)
      {
          for (int outerY = 0; outerY &lt; bmpHaystack.Height - bmpNeedle.Height; outerY++)
          {
              for (int innerX = 0; innerX &lt; bmpNeedle.Width; innerX++)
              {
                  for (int innerY = 0; innerY &lt; bmpNeedle.Height; innerY++)
                  {
                      Color cNeedle = bmpNeedle.GetPixel(innerX, innerY);
                      Color cHaystack = bmpHaystack.GetPixel(innerX + outerX, innerY + outerY);
  
                      if (cNeedle.R != cHaystack.R || cNeedle.G != cHaystack.G || cNeedle.B != cHaystack.B)
                      {
                          goto notFound;
                      }
                  }
              }
              location = new Point(outerX, outerY);
              return true;
  
          notFound:
              continue;
          }
      }
      location = Point.Empty;
      return false;
  }    
  </code></pre>