Tim Roberts wrote: > Boris Borcic wrote: >> I am trying to use UI Automation to drive an MS Windows app with pywinauto. >> >> I need to scrape the app's window contents and use some form of OCR to get at >> the texts (pywinauto can't get at them). >> >> As an alternative to integrating an OCR engine, and since I know the fonts >> and >> sizes used to write on the app's windows, I reasoned that I could base a >> simple >> text recognition module on the capability to drive MSWindows text rendering >> - eg >> to generate pixmaps of texts I expect to find in the driven app's windows, >> exact >> to the pixel. >> >> The advantage of that approach would be exactitude and self-containment. >> > > But what if the user has font anti-aliasing or, even worse, ClearType > turned on? Your screen image won't be pixel-for-pixel accurate. This > seems like a very delicate solution to me.
That's why I spoke of "wrapping the the Windows UI text rendering engine", ie so that the text gets rendered according to user options. And as a matter of fact, my tests with Idle - the paragraph just after those you cited : >> I've verified manually inside an Idle window, that indeed I could produce >> pixmaps of expected app texts, exact to the pixel (with Tkinter+screen >> capture at least). - where done with cleartype on and were pixel-to-pixel accurate. > > I'm surprised you can't get at the window contents. Have you used the > spyxx.exe utility to poke through the window structure? > I think that's what pywinauto does as well, and I had no better results with another automation module that uses pywin32 rather than ctypes (winguiauto iirc). Regards, Boris Borcic _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32