开发者

Display a Graphics2D as JPG in JSP

Is it possible to use Graphics2D in a servlet?

And if I have a Graphics2D object, is it possible for me to convert it to a .jpg image and displ开发者_Go百科ay it in a JSP page?


In my opinion yes, Read the link for better understanding.


JFreeChart has a good example of doing this. To accommodate older versions, it provides a org.jfree.chart.encoders.SunJPEGEncoderAdapter. The encode() method shows how to use ImageIO for either byte array or stream.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜