[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools] New article: Graphics Context - Quick on the draw
|
Graphics Context - Quick on the draw
by Joe Winchester (IBM) July 3, 2003
http://eclipse.org/articles/Article-SWT-graphics/SWT_graphics.html
The package org.eclipse.swt.graphics contains classes that allows management of graphics resources.
Graphics can be drawn on anything that implements org.eclipse.swt.graphics.Drawable, which includes
org.eclipse.swt.widgets.Control and org.eclipse.swt.graphics.Image. The class
org.eclipse.swt.graphics.GC 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.