[python-win32] windows text rendering question

Tim Roberts timr at probo.com
Tue Jan 23 18:58:28 CET 2007


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.

I'm surprised you can't get at the window contents.  Have you used the
spyxx.exe utility to poke through the window structure?

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-win32 mailing list