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, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to