Hi.
I have a program that creates some BufferedImage with
offscreen = new BufferedImage (2000,2000,BufferedImage.TYPE_INT_ARGB);
I draw something to it and draw a filter with a Color f.e. (new Color(0,0,50,100))
afterwards so that the hole image looks a bit blue with a transparent color.
When I save this Image with the following method something happens that shouldn´t.
This is the method:
try {
ByteArrayOutputStream out = new ByteArrayOutputStream( 0xfff );
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder( out );
JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(foto);
param.setQuality(1.0f, true );
encoder.encode(Foto, param );
FileOutputStream fos = new FileOutputStream(f);
fos.write( out.toByteArray() );
fos.close();
out.close();
} catch (Exception e) {
}
It should save my Image foto with the maximum of quality and it does,
but what happens is that the colors of my saved JPG don´t match the ones I see when I draw this Image
to the screen.
Why?
How can I change this to get my real pictures saved?