Grisgram Posted February 20, 2008 Posted February 20, 2008 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
Richard Robertson Posted February 21, 2008 Posted February 21, 2008 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.
Grisgram Posted February 21, 2008 Author Posted February 21, 2008 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.
martin Posted March 3, 2008 Posted March 3, 2008 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now