IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Re: Java graphics manipulation
I don't think the built-in stuff implements PBM, but basically you use ImageIO.read to create a BufferedImage, get the Graphics2D from that image, read in the other image, then use Graphics2D.drawImage to insert the second in the first. ImageIO.write outputs the result.
BufferedImage i1 = ImageIO.read(stream1);\nBufferedImage i2 = ImageIO.read(stream2);\ng2 = i1.getGraphics();\ng2.drawImage(i2, null, x, y);\nImageIO.write(i1, "pbm", outputStream);


Supposedly the JAI Image I/O Tools supports PBM.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Will look into.
Why, oh why, do I always wait till the last minute. :-)
New Cheated.
Did some quick study on the .bmp format and converted the .pbm image to bitmap on the fly. The conversion is mostly automatic though I had to run an XOR (^) on all the bytes because pbm is inverted from bitmap. And, for some stupid reason, the bitmap images are upside down (starting from bottom left).

Anyhow, once in .bmp format, the options are a little more amenable.
     Java graphics manipulation - (ChrisR) - (3)
         Re: Java graphics manipulation - (admin) - (2)
             Will look into. - (ChrisR)
             Cheated. - (ChrisR)

You will be boiled in vegetable oil and packaged for housecats.
63 ms