Navigation:
Up,
Table of Contents,
Index,
Rectangles (Rectangle)
|
Rectangle r ( int x1, int y1, int x2, int y2);
|
|
Creates
a rectangle with diagonal (x1, y1)
(x2, y2).
|
|
int
|
r.x1 ()
|
Returns x-coordinate of the
diagonal's first endpoint.
|
|
int
|
r.y1 ()
|
Returns y-coordinate of the
diagonal's first endpoint.
|
|
int
|
r.x2 ()
|
Returns x-coordinate of the
diagonal's second endpoint.
|
|
int
|
r.y2 ()
|
Returns y-coordinate of the
diagonal's second endpoint.
|
Example
The following code draws a rectangle with lower left
corner (100, 100) and upper right corner (200, 200) and waits for a
mouseclick to finish.
#include <ifmwindow>
int main()
{
wio << Rectangle(100, 100, 200, 200) << flush;
wio.wait_for_mouse_click();
}
Next: Class declaration of FilledRectangle
Navigation:
Up,
Table of Contents,
Index,
Michael Hoffmann. Mon, October 7, 2002.