Pattern

Instances of this class represent patterns to use while drawing. Patterns can be specified either as bitmaps or gradients. <p> Application code must explicitly invoke the <code>Pattern.dispose()</code> method to release the operating system resources managed by each instance when those instances are no longer required. </p> <p> This class requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>

@see <a href="http://www.eclipse.org/swt/snippets/#path">Path, Pattern snippets</a> @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: GraphicsExample</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

@since 3.1

Constructors

this
this(Device device, Image image)

Constructs a new Pattern given an image. Drawing with the resulting pattern will cause the image to be tiled over the resulting area. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>

this
this(Device device, float x1, float y1, float x2, float y2, Color color1, Color color2)

Constructs a new Pattern that represents a linear, two color gradient. Drawing with the pattern will cause the resulting area to be tiled with the gradient specified by the arguments. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>

this
this(Device device, float x1, float y1, float x2, float y2, Color color1, int alpha1, Color color2, int alpha2)

Constructs a new Pattern that represents a linear, two color gradient. Drawing with the pattern will cause the resulting area to be tiled with the gradient specified by the arguments. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>

Members

Functions

isDisposed
bool isDisposed()

Returns <code>true</code> if the Pattern has been disposed, and <code>false</code> otherwise. <p> This method gets the dispose state for the Pattern. When a Pattern has been disposed, it is an error to invoke any other method using the Pattern.

toString
String toString()

Returns a string containing a concise, human-readable description of the receiver.

Variables

handle
org.eclipse.swt.internal.gtk.OS.cairo_pattern_t* handle;

the OS resource for the Pattern (Warning: This field is platform dependent) <p> <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms and should never be accessed from application code. </p>

Inherited Members

From Resource

device
Device device;

the device where this resource was created

dispose
void dispose()

Disposes of the operating system resources associated with this resource. Applications must dispose of all resources which they allocate.

getDevice
Device getDevice()

Returns the <code>Device</code> where this resource was created.

isDisposed
bool isDisposed()

Returns <code>true</code> if the resource has been disposed, and <code>false</code> otherwise. <p> This method gets the dispose state for the resource. When a resource has been disposed, it is an error to invoke any other method using the resource.

Meta