Programmer's Reference

Drawing rectangles

The drawRectangle:x:y:width:height:, fillRectangle:x:y:width:height:, drawRectangles:rectangles: and fillRectangles:rectangles: messages are used to draw outlined and filled rectangles. The fillRectangle: and fillRectangles: messages are shown in the following example:

CgWindow default
    fillRectangle: CgGC default
    x: 10
    y: 10
    width: 50
    height: 50.


Figure SP006070 not displayed.



| rects rect1 rect2 |
rect1 := 10@10 extent: 50@50.
rect2 := 70@10 extent: 50@50.
rects := Array with: rect1 with: rect2.
 
CgWindow default
    fillRectangles: CgGC default
    rectangles: rects.


Figure SP006075 not displayed.



[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]