Project: SWT
Bug 93759 Can't drawPath on image GC
Reported: 2005-05-04 23:23:27 | Status: resolved fixed

Nothing is drawn to the screen in this example. Replacing the call to drawPath with drawPlain works as expected. I'm using M6. shell.addPaintListener(new PaintListener() { public void paintControl(PaintEvent e) { Rectangle clientArea=shell.getClientArea(); Image image = new Image(display,clientArea.width,clientArea.height); GC igc = new GC(image); igc.setBackground(e.gc.getBackground()); igc.setForeground(e.gc.getForeground()); igc.fillRectangle(0,0,clientArea.width,clientArea.height); drawPath(igc); e.gc.drawImage(image,clientArea.x,clientArea.y); igc.dispose(); image.dispose(); } void drawPath(GC gc) { Path path=new Path(display); path.moveTo(10,10); path.lineTo(20,20); path.close(); gc.drawPath(path); path.dispose(); } void drawPlain(GC gc) { gc.drawLine(10,10,20,20); } });

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Gdip.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java