Microsoft KB Archive/44352

= DRAW Statement Doesn't Affect WINDOW's Physical Coordinates =

Article ID: 44352

Article Last Modified on 11/21/2006



This article was previously published under Q44352



SUMMARY
The DRAW statement does not change the screen's logical coordinates, which are set using the WINDOW statement. The DRAW statement uses only physical coordinates, whereas normal graphics statements (PSET, LINE, CIRCLE) are specified with view coordinates.

While the view coordinates are not changed by the DRAW statement, the physical coordinates [returned in POINT(0) and POINT(1)] are changed by the normal graphics statements.

This information applies to QuickBasic Versions 3.00, 4.00, 4.00b, and 4.50, to Microsoft Basic Compiler 6.00 and 6.00b, and to Microsoft Basic PDS Version 7.00.



MORE INFORMATION
In the following code sample, the first CIRCLE specified with view coordinates sets the physical coordinates [returned by POINT(0) and POINT(1)] to the equivalent point (at the center of the CIRCLE). The ensuing DRAW statement draws a line from the center point to the point specified in the DRAW. This DRAW statement changes the physical coordinates [shown by the values of POINT(0) and POINT(1)] but leaves the view coordinates unchanged [POINT(2) and POINT(3)]. The second CIRCLE statement will be centered on the view coordinates of the center point of the first CIRCLE, rather than the physical coordinates of the other end of the line created with the DRAW.

Code Example
SCREEN 9 WINDOW (0, 0)-(60, 60) CIRCLE (10, 10), 4  ' Set the 1st point Physical and view correspond

PRINT &quot;First CIRCLE Coordinates:&quot; PRINT &quot;Physical coordinates = (&quot;; POINT(0); &quot;,&quot;; POINT(1); &quot;)&quot; PRINT &quot;View    coordinates = (&quot;; POINT(2); &quot;,&quot;; POINT(3); &quot;)&quot; PRINT

DRAW &quot;M20,20&quot;        ' DRAW line -- Physical changed; view unchanged

PRINT &quot;DRAW Coordinates:&quot; PRINT &quot;Physical coordinates = (&quot;; POINT(0); &quot;,&quot;; POINT(1); &quot;)&quot; PRINT &quot;View    coordinates = (&quot;; POINT(2); &quot;,&quot;; POINT(3); &quot;)&quot; PRINT

CIRCLE STEP(0, 0), 8 ' Centers around 1st CIRCLE not far end of DRAW

PRINT &quot;Second CIRCLE Coordinates:&quot; PRINT &quot;Physical coordinates = (&quot;; POINT(0); &quot;,&quot;; POINT(1); &quot;)&quot; PRINT &quot;View    coordinates = (&quot;; POINT(2); &quot;,&quot;; POINT(3); &quot;)&quot; PRINT

END

Additional query words: QuickBas BasicCom

Keywords: KB44352

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.