Sign in to follow this  
Followers 0
Grisgram

Bug in AutoItX.PixelChecksum?

4 posts in this topic

Hi,

we experimented today a little with the PixelChecksum wrapper in the AutoItX com control and we found that the return value for a region greater than about 10 pixels always returns -2.17 billion which looks like an integer overflow.

should the return value be a long?

in any .au3 script it works fine, but not with the dll (the same calls, the same region and the same amount of pixels scanned).

Did anyone else experience this problem or is there any solution around?

I used the search function but didn't find any topic on that behavior.

thanks for any help

grisgram

Share this post


Link to post
Share on other sites



What does your calling code look like? What language are you using? We might be able to point out a simple mistake if that is the problem.

Share this post


Link to post
Share on other sites

I'm using Visual C# 2005 and what I tried to do is a simple program that captures a screen region for me, paste it into a PictureBox control and then calculate the checksum for me.

The capture part is working fine, the picture is displayed, and then this method is called:

(The image is always painted at 0,0 which is the top left corner of the picture box)

AutoItX3Class ai = new AutoItX3Class();

        private void GetCheckSum()
        {
            if (pic.Image != null)
            {
                pic.Refresh();
                lblChecksum.Text = ai.PixelChecksum(pic.Left, pic.Top,
                    pic.Image.Width - 1, pic.Image.Height - 1 , 1).ToString();
            }
            else
                lblChecksum.Text = "0";
        }

So, what happens?

As long as the captured image is 3x3 pixels or smaller everything works fine, but as soon as I capture a larger area (for my current project I need to capture 48x16 pixels, which is one specific line of text in a graphical application), the return value is always -2.17 billion.

On the other side, the same "code" (= the same way of capturing) in a pure AutoIt-GUI-Application works fine and I get correct checksums.

Thanks for any more help on this.

Share this post


Link to post
Share on other sites

I'm using Visual C# 2005 and what I tried to do is a simple program that captures a screen region for me, paste it into a PictureBox control and then calculate the checksum for me.

The capture part is working fine, the picture is displayed, and then this method is called:

(The image is always painted at 0,0 which is the top left corner of the picture box)

AutoItX3Class ai = new AutoItX3Class();

        private void GetCheckSum()
        {
            if (pic.Image != null)
            {
                pic.Refresh();
                lblChecksum.Text = ai.PixelChecksum(pic.Left, pic.Top,
                    pic.Image.Width - 1, pic.Image.Height - 1 , 1).ToString();
            }
            else
                lblChecksum.Text = "0";
        }

So, what happens?

As long as the captured image is 3x3 pixels or smaller everything works fine, but as soon as I capture a larger area (for my current project I need to capture 48x16 pixels, which is one specific line of text in a graphical application), the return value is always -2.17 billion.

On the other side, the same "code" (= the same way of capturing) in a pure AutoIt-GUI-Application works fine and I get correct checksums.

Thanks for any more help on this.

I don't know anything about C#, but I assume some things are similar to C which I have used. PixelChecksum returns a number not a string so your code looks wrong to me.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
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
Sign in to follow this  
Followers 0