Capturing/Recognizing Text In Another Window

Bengt Richter bokr at oz.net
Thu Oct 16 18:38:34 EDT 2003


On 15 Oct 2003 22:37:23 -0700, jeffrey123d at yahoo.com (JD) wrote:

>To answer my own question for the benefit of others who are
>interested, do it like this:
>
>import win32gui
>import win32ui
>
>DC = win32ui.GetActiveWindow().GetDC()
>MemDC = DC.CreateCompatibleDC( None )
>BitMap = win32ui.CreateBitmap()
>BitMap.CreateCompatibleBitmap(DC, 400, 400)
>MemDC.SelectObject( BitMap )
>MemDC.BitBlt((0,0), (400, 400), DC, (0,0), 13369376)
>BitMap.SaveBitmapFile(MemDC, "c:\mybitmap.bmp")

Just wondering what the BitBlt is doing with
 >>> hex(13369376)
 '0xcc0020'

Regards,
Bengt Richter




More information about the Python-list mailing list