[python-win32] Have IHTMLWindow2 object need correspondingIHTMLWindow3 object and flash box
Tim Roberts
timr at probo.com
Sat Jul 28 01:11:16 CEST 2007
Richard Bell wrote:
> def flash(top, left, bottom, right):
> gui_dc = win32gui.GetDC(0) # int handle screen DC
> pycdc = win32ui.CreateDCFromHandle(gui_dc) # PyCDC object
> pycdc.SetROP2(7) # R2_XOR
> brush = win32ui.CreateBrush(0, 0, 0) # create a brush (solid,
> no color)
> pycdc.SelectObject(brush) # put it in the dc
> pen = win32ui.CreatePen(0, 3, 0x00ff00) # colorref is 0x00bbggrr
> pycdc.SelectObject(pen) # put it in the dc
>
There's a minor performance issue issue here. You are creating a solid
black brush. That means when you do the Rectangle call, the graphics
driver actually has to go draw the inside with black. Now, since you
specified R2_XOR, that will have no effect on the pixels (since x ^ 0 is
0), but the graphics chip will still draw it.
If you use the hollow brush, as I suggested, then the driver won't even
be ASKED to fill the interior.
brush = win32ui.GetStockObject( 5 ) # HOLLOW_BRUSH
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the Python-win32
mailing list