ok, after several requests to convert this 4K Game.(
http://www.pkl.net/~rsc/4KShooter/4KShooter.jar)
So it doesn't use the Windows only Experimental alpha trans.
I decided to do it. It was only 10mins work... and I ended up with this (note the lack of a cool blur effect ;P):-
http://www.pkl.net/~rsc/4KShooter/4KShooterSE.jarand it runs perfectly on 1.4.2_03
I then tried it on the 1.5beta..... and its bugged :-/
It seems that rotation AffineTransforms are screwing up the ColorModel of the destination image.
The source image is a managed Image (BITMASK),
The destination Image is a managed image (BITMASK).
When the rotation angle is anything but 0, the palette gets screwed up.
the sourcecode is available here (though I have to warn you its size optimised code

):-
http://www.pkl.net/~rsc/4KShooter/A.javaTo summarise, im doing this :-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| BufferedImage loadedImage = ImageIO.read(getClass().getResource(STRING_SHIPS_FILENAME));
(objectImages[0][0] = gc.createCompatibleImage(IMAGE_WIDTH,IMAGE_HEIGHT, Transparency.BITMASK)) .createGraphics().drawImage(loadedImage,(IMAGE_WIDTH-SHIP_WIDTH)/2,(IMAGE_HEIGHT-SHIP_HEIGHT)/2,null);
BufferedImage src = objectImages[0][0]; for(int i =0;i < NUM_ROTATIONS;i++) { (g = (objectImages[0][i] = gc.createCompatibleImage(IMAGE_WIDTH,IMAGE_HEIGHT,Transparency.BITMASK)).createGraphics()) .rotate(i*ANGLE_INC,IMAGE_WIDTH/2,IMAGE_HEIGHT/2); g.drawImage(src,0,0,null); } |