Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
BufferedImage image = JPEGCodec.createJPEGDecoder(dis).decodeAsBufferedImage();
// dis ist eine Stream
public void writeLossyImage( BufferedImage b, float quality ) throws java.io.IOException
{
if ( b != null )
{
writeInt( 1 ); // flag as non-null
int w = b.getWidth();
int h = b.getHeight();
ByteArrayOutputStream out = new ByteArrayOutputStream( w * h * 4 );
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder( out );
JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam( b );
param.setQuality( quality, false ); // 90% qualith JPEG
encoder.setJPEGEncodeParam( param );
encoder.encode( b );
byte[] buf = out.toByteArray();
int size = out.size();
writeInt( size );
write( buf, 0, size );
out.close();
}
else
{
writeInt( 0 );
}
}