Jump to content

I need some help optimizing a file based pixel search


Delta
 Share

Recommended Posts

 

for some reason AutoIt + DLLs + My computer = Crash.

Thats not your fault, it was mine! I copied some code from an other of my scripts and did a heavy mistake which causes AutoIt to crash in some cases....  ;) I try to explain:

The findbytes()-function finds bytes, not pixels! If there is a sequence of 3 bytes, which is not ONE pixel but a part of two pixels then the line  

$i = FindBytes($Scan0, $i + 1, (Abs($stride) * ($Height)), $ptr, 3) + 1
crashes because the third parameter (which should be the rest of the size of the searching) was wrong....so
$i = FindBytes($Scan0, $i + 1, (Abs($stride) * ($Height))-$i, $ptr, 3) + 1
is right!

The bug is fixed now in the above scripts!  

Edited by AndyG
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...