Where's the border for asking question and posting topics. For quite a while I didn't realize that JAI was a separate package to be downloaded and asked a lot of Graphic2D questions on the JAI list, but got some answers by nice people. But then I noticed that some people were concerned about the types of questions being posted on JAI. Anyway, please let me know which list the following question best belongs in,

I have a situation where I need to make a smaller buffered image from a larger one, and I want it to have the same type and colour model, but different dimensions. Can this be done, and if so how?

Currently I do something like

BufferedImage original = ImiageIO.read(file.png);
BufferedImage printable = new BufferImage(
    (int)(scale * original.getWidth()),
    (int)(scale * original.getHeight()),
    BufferedImage.TYPE_3BYTE_BRG);

AffineTransform transform = new AffineTransform();
transform.scale(scale, scale);

Graphics2D g = printable.createGraphic();
g.drawImage(original, transform, null);


The problem is that original is TYPE_CUSTOM and the Java runtime won't let me create a BufferedImage of type custom.

Any help would be appreciated.

Cheers, Eric

Reply via email to