A Graphics Context or GC is an object that contains drawing attribute information, such as foreground color, background color, line width, and line style. When an object is drawn on a drawable, the drawable references the graphics context to determine how the object should appear.For interactive experimentation and testing, there is a default GC that can be accessed using CgScreen default defaultGC or CgGC default.In the following figure, a drawable (the root window of the default screen) receives a message to draw a 100x100 filled rectangle at 20@20. The programmer provides a graphics context called aGC. The drawable references aGC to find out how to display the rectangle.
|