Bug 136691 Snippet139 - No more handles
Version: 3.2.0 Build id: I20060412-0847 Run Snippet139. The following SWTError is shown: Exception in thread "main" org.eclipse.swt.SWTError: No more handles at org.eclipse.swt.SWT.error(SWT.java:3400) at org.eclipse.swt.SWT.error(SWT.java:3297) at org.eclipse.swt.SWT.error(SWT.java:3268) at org.eclipse.swt.graphics.Image.init(Image.java:1067) at org.eclipse.swt.graphics.Image.<init>(Image.java:552) at org.eclipse.swt.snippets.Snippet139.main(Snippet139.java:102)
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet139.java
static ImageData rotate(ImageData srcData, int direction) {
	int bytesPerPixel = srcData.bytesPerLine / srcData.width;
	int destBytesPerLine = (direction == SWT.DOWN)? srcData.width * bytesPerPixel : srcData.height * bytesPerPixel;
	byte[] newData = new byte[(direction == SWT.DOWN)? srcData.height * destBytesPerLine : srcData.width * destBytesPerLine];
	int width = 0, height = 0;
	for (int srcY = 0; srcY < srcData.height; srcY++) {
		for (int srcX = 0; srcX < srcData.width; srcX++) {
			int destX = 0, destY = 0, destIndex = 0, srcIndex = 0;
			switch (direction){
				case SWT.LEFT: 
					destX = srcY;
					destY = srcData.width - srcX - 1;
					width = srcData.height;
					height = srcData.width; 
					break;
				case SWT.RIGHT: 
					destX = srcData.height - srcY - 1;