/** * Direct output picture for base64 code * * @param key * @param imageurl * @param width * @param height * @throws ioexception * @ algorithm:
* @ Date: January 28, 2015 */public void Putimage (String key, image image) throws IOException {//Image->bufferreimage BufferedImage bimg = new BufferedImage (Image.getwidth (null), image.getheight (null), Bufferedimage.type_int_r
GB);
Graphics g = bimg.creategraphics ();
G.drawimage (image, 0, 0, NULL);
G.dispose ();
Bufferimage->base64 Bytearrayoutputstream outputstream = new Bytearrayoutputstream ();
Imageio.write (bimg, "JPG", outputstream);
Base64encoder encoder = new Base64encoder ();
String base64img = Encoder.encode (Outputstream.tobytearray ()); Output this.content = This.content.replace ("@{" + Key + "}", "buffer Reimage bufferedimage bimg = new BufferedImage (Image.getwidth (null), image.getheight (null), BufferedImage.
TYPE_INT_RGB);
Graphics g = bimg.creategraphics ();
G.drawimage (image, 0, 0, NULL);
G.dispose ();
Bufferimage->base64 Bytearrayoutputstream outputstream = new Bytearrayoutputstream ();
Imageio.write (bimg, "JPG", outputstream);
Base64encoder encoder = new Base64encoder ();
String base64img = Encoder.encode (Outputstream.tobytearray ());
This.content = This.content.replace ("@{" + Key + "}", "This article welcomes reprint, reprint please specify: http://itsshq.com/article-255.html