Hashim Posted November 5 Share Posted November 5 (edited) 9 minutes ago, ioa747 said: it is not mine, it belongs to the UWPOCR function , simply because it passes directly to the function I have added the relevant parameters. I don't remember I have to look it up Don't worry about it, I was trying to speed up my script to by doing it in memory instead of using your _ScreenCapture function and relying on the filesystem, but with other optimisations I've managed to make it fast enough for my purposes. Edited November 5 by Hashim Link to comment Share on other sites More sharing options...
ioa747 Posted November 6 Author Share Posted November 6 Update the script above to Version: 4.0 I lightened it up a bit from the legacies it had from the previous script (with big numbers) which assumed that each Vpoint could be made up of more pixels so that it is more readable and lighter Hashim and argumentum 2 I know that I know nothing Link to comment Share on other sites More sharing options...
argumentum Posted November 6 Share Posted November 6 (edited) Local $hBitmap = _GDIPlus_BitmapCreateFromFile($sFileName) If @error Then Return SetError(1, 0, "") ; because the user ( me ) might do the unexpected ;) Edited November 6 by argumentum English ioa747 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
ioa747 Posted November 6 Author Share Posted November 6 I put it, for Version: 5.0 argumentum 1 I know that I know nothing Link to comment Share on other sites More sharing options...
Hashim Posted November 6 Share Posted November 6 (edited) Hi ioa747, I've run into a problem using the script (both V3 and V4) inside of my For loop over my whole dataset of a million numbers. Everything works fine (bitmap recognition is perfect) until it gets to exactly 9964 (possibly 9965 depending on my maths) in the loop, at which point it crashes with a fatal error (like a MsgBox with no data). This happens no matter what input number I start the loop, so the problem seems to be the 9964th iteration of the loop rather than the number itself. From my debugging it feels like this is something to do with GDIPlus and/or memory consumption, either in the script or in the custom _ScreenCapture function I am using to take the screenshot. Do you have any quick ideas about what might be causing this and how to solve it? If not I can post all of my code tomorrow. Edited November 6 by Hashim Link to comment Share on other sites More sharing options...
ioa747 Posted November 6 Author Share Posted November 6 (edited) I don't know what to say. after each call to the custom _ScreenCapture function you release the GDIPlus memory with _WinAPI_DeleteObject($hHBitmap) _GDIPlus_BitmapDispose($hImage) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hImageCtxt) _GDIPlus_Shutdown() like I do in the function _ScreenCapture one more thing in the numbers you passed us each time there are three numbers in a row follows that the total will be 999 numbers there are more in each row? why need dataset of a million numbers? Edited November 6 by ioa747 add _GDIPlus_GraphicsDispose I know that I know nothing Link to comment Share on other sites More sharing options...
ioa747 Posted November 6 Author Share Posted November 6 You can monitor GDI handle usage in Task Manager: Open Task Manager, go to the "Details" tab, right-click on a column header, and select "Select columns." Enable "GDI object" to monitor the GDI object count for your script. I know that I know nothing Link to comment Share on other sites More sharing options...
argumentum Posted November 6 Share Posted November 6 https://www.autoitscript.com/forum/index.php?showtopic=197259&view=findpost&p=1414754 ? ioa747 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Nine Posted November 6 Share Posted November 6 At first glance, you do not use _GDIPlus_GraphicsDispose Hashim and ioa747 2 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Hashim Posted November 6 Share Posted November 6 (edited) ..... Edited November 11 by Hashim Link to comment Share on other sites More sharing options...
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