Draw rectangle on a Window DC

Paul McGuire ptmcg at austin.rr._bogus_.com
Fri Jan 5 08:47:33 EST 2007


"Gabriel Genellina" <gagsl-py at yahoo.com.ar> wrote in message 
news:mailman.2300.1167963723.32031.python-list at python.org...
> At Thursday 4/1/2007 07:07, Raymond wrote:
>
>>I want to Draw rectangle on Dc when gived a position. Can you teach me? 
>>Let me view your code?
>
> This is more a Windows question. See 
> http://msdn.microsoft.com/library/en-us/gdi/rectangl_4b03.asp
>
> py>from win32gui import GetDC
> py>hdc=GetDC(0)
> py>from win32gui import Rectangle
> py>Rectangle(hdc, 100,100, 300,300)
> py>ReleaseDC(hdc,0)
> 0
> py>
>
> You should see a white square on your screen.
>

Nice example.  First line should be:

from win32gui import GetDC, ReleaseDC

-- Paul 





More information about the Python-list mailing list