Article View: comp.windows.interviews
Article #144Problem on Window Draw
From: Chittathoor M. Sriram
Date: Fri, 31 Jul 1992 21:22
Date: Fri, 31 Jul 1992 21:22
36 lines
1528 bytes
1528 bytes
Hi, I am facing a problem while drawing a Square box on the screen. The problem is as follows. I have a class derived from Interactor. I have redefined the Redraw method in the Interactor so that I can do my own drawings. While instatiating my derived class I set the shape parameter to be shape->Rect (w, h) where w = width ( my case 200) h = height (my case 200). Finally In the Redraw Virtual member function that I have derived I do the following to draw a rectangle on the screen output->Rect (canvas, x1,y1,x2,y2); where x1 =0, y1 = 0, x2 =200 , y2 =200. What I see on the screen is only two sides of the rectangle (the left and bottom). I am able to draw all the four sides If I specify a larger width and height to the shape parameter. For example saying shape->Rect(201,201) output->Rect(canvas, 0,0,200,200). That is I will have to request for more space than I actually need . It seems like there is some rounding problem happening somewhere but I am not sure where exactly. Any Pointers will be appreciated. Thanks for your time. SRiram
Technical Details
Message-ID:
<9207312122.AA21028@sparc0.brc.uconn.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!brc.uconn.edu!sriramShow Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!brc.uconn.edu!sriram From: sriram@brc.uconn.edu (Chittathoor M. Sriram) Subject: Problem on Window Draw Message-ID: <9207312122.AA21028@sparc0.brc.uconn.edu> Sender: news@shelby.stanford.edu (USENET News System) Organization: Internet-USENET Gateway at Stanford University Date: Fri, 31 Jul 1992 21:22:44 GMT Lines: 37