blob: f1a98d8f6d0b0cf1b6d26e2c0cba15e492114045 [file] [log] [blame]
<!DOCTYPE doc [
<!ENTITY trade "&#153;">
<!ENTITY reg "&#174;">
<article link="SWT_graphics.html">
<title>Graphics Context - Quick on the draw</title>
<date>July 3, 2003</date>
<category>User interface</category>
<name>Joe Winchester</name>
The package <code></code> contains
classes that allow management of graphics resources. Graphics
can be drawn on anything that implements
<code></code>, which includes
<code>org.eclipse.swt.widgets.Control</code> and
<code></code>. The class
<code></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.