Project: SWT
Bug 382175 [Cairo] Images created with external GdkPixmap* can't be drawn using GC.drawImage()
Reported: 2012-06-09 16:54:20 | Status: resolved fixed

In WindowBuilder project I have to create an Image instance using external GdkPixmap* value. I used Image.gtk_new() method to create such Image. Then I need to draw this image on some GC. This works fine with Cairo disabled. When Cairo is enabled, the image is not drawn. The workaround is to invoke Image.getImageData() method. After this invocation it works fine. Sample code: Image image = Image.gtk_new(null, SWT.BITMAP, pixmapHandle, 0); Image mainImage = new Image(null, 240, 160); GC gc = new GC(mainImage); // image.getImageData(); // uncomment to get it working gc.drawImage(image, 0, 0); gc.dispose(); // save mainImage using ImageLoader

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java