| The package <code>org.eclipse.swt.graphics</code> contains classes that allow management of graphics resources. Graphics can be drawn on anything that implements <code>org.eclipse.swt.graphics.Drawable</code>, which includes
<code>org.eclipse.swt.widgets.Control</code> and
<code>org.eclipse.swt.graphics.Image</code>. The class
<code>org.eclipse.swt.graphics.GC</code> encapsulates all of
the drawing API, including how to draw lines and shapes, draw
text and images and fill shapes. This article shows how to use
a GC to draw onto an Image, or onto a control through its
paintEvent callback. The Canvas control, specifically designed
for drawing operations, has a number of constructor style bits
that allow you to determine when and how painting
occurs, and the article shows how to use these. Categories: SWT, User interface, RCP
|