1. Win32Lib: drawRectangle question
- Posted by Brendon Sly <bwsly at infoscience.otago.ac.nz> May 08, 2001
- 647 views
Hi All, While messing with something last night I found an interesting effect=20= with drawRectangle. If I drew a rectangle (filled or not) then plotted=20= the corner points, it wouldn't match up. I've attached the smallest piece of code that will show you what I'm on = about. The top-left dark point is on the yellow rectangle but the other three=20= are outside it. I've tried this on my home machine (Win98) and work=20 (Win2000) and get the same result. I can deal with using 'drawRectangle(A, B, x1, y1, x2+1, y2+1)' but I'm = just wondering if that's the way it's supposed to be or have I missed=20= something in the win32lib docs. Oh yeah, last thing. I'm using win32lib v0.55.1. Thanks. Brendon :| -- include Win32Lib.ew without warning global constant MyWin =3D create( Window, "MyWin", 0, Default, Default, = 300, 300, 0) setWindowBackColor( MyWin, White ) procedure MyWin_onPaint ( int x1, int y1, int x2, int y2 ) setPenColor(MyWin, Yellow) drawRectangle(MyWin, True, 10, 10, 100, 100) setPixel(MyWin, 10, 10, Black) setPixel(MyWin, 10, 100, Black)=20 setPixel(MyWin, 100, 10, Black)=20 setPixel(MyWin, 100, 100, Black)=20 end procedure onPaint[MyWin] =3D routine_id("MyWin_onPaint") WinMain( MyWin, Normal )
2. Re: Win32Lib: drawRectangle question
- Posted by David Cuny <euphoria_coder at HOTMAIL.COM> May 08, 2001
- 546 views
Brendon Sly wrote: >If I drew a rectangle (filled or not) then plotted the corner points, it >wouldn't match up. Unfortunately, that's how the Windows GDI call is supposed to work. There's some sort of logic to it, but the end result is still rather counter-intuitive. -- David Cuny