Org.eclipse.swt.graphics.GC
lastmod 2026-11-10created 2014-05-252 edits
GC (Graphics Context) is the SWT class responsible for drawing operations. It provides methods for drawing lines, rectangles, images, and strings, along with drawing properties such as color, font, and line width. Usually you use the GC passed via a PaintEvent, or create one directly targeting an Image or Control; since it wraps operating system resources, one you create yourself must always be released with dispose(). For double buffering, draw onto an offscreen image with a GC and then copy it to the screen.
Favorite site
References
-
Graphics_Context_-_Quick_on_the_draw.pdf ↩