}
public void paint(GC gc, int width, int height) {
if (!example.checkAdvancedGraphics())
return;
Device device = gc.getDevice();
if (image == null) {
image = example.loadImage(device, "irmaos.jpg");
Rectangle rect = image.getBounds();
FontData fd = device.getSystemFont().getFontData()[0];
font = new Font(device, fd.getName(), rect.height / 4, SWT.BOLD);
gc.setFont(font);
Point size = gc.stringExtent(text);
textWidth = size.x;
textHeight = size.y;
}
Path path = new Path(device);
path.addString(text, x, y, font);
gc.setClipping(path);
Rectangle rect = image.getBounds();
gc.drawImage(image, 0, 0, rect.width, rect.height, 0, 0, width, height);
gc.setClipping((Rectangle) null);
gc.setForeground(device.getSystemColor(SWT.COLOR_BLUE));
gc.drawPath(path);
path.dispose();
}