OK, I’ve googled a bit for this and haven’t found any leads. Any help would be appreciated…
How do I directly party on the bitmap in Java (i.e. draw arbitrary, dynamic stuff there)?
I’m trying to stay Java 1.1 compatible. I’m double-buffering, using an off-screen Image. Mostly, I want to blit other images into the main off-screen image, but the set of functions provided is rather limited, and so I’d like to do at least some stuff more dynamically (i.e. color-remapping as I blit, arbitrary rotation, etc…). I understand that this is likely to be somewhat slower than the provided drawImage functions - I can handle that. But of course I don’t want to have to drop all the way down to using 1 x 1 fillRects or the like.
In C, you can generally get a ptr to the dest bitmap (effectively as an array of bytes or DWORDs), then walk that array and do what you like - anything roughly comparable in Java?
I looked at BufferedImage, but that appears to require something higher than Java 1.1 (it’s an invalid type when I compile for 1.1 - I didn’t test it in 1.4, though).
I’ve seen the reference code here:
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/MemoryImageSource.html
But this basically requires you to create a new image every time. So, for instance, if I had a slowly spinning ship sprite, then I’d have to create a new version of that sprite every frame. It’s doable, but not an ideal solution - what I’d like is to have my ship, in it’s normal non-rotated form, and dynamically blit it every frame at whatever the current rotation is.
Any thoughts and/or websites with reference code?
Thanks,
Phil