有扩展包JAI,自己找找
不然的话只好看GIF算法自己写了。
不然的话只好看GIF算法自己写了。
解决方案 »
- 100分求java经典笔试题(分不够还可以加)
- 最后散次!!!!!!
- 我在eclipse环境下写了一个与sqlserver2000连接的程序,但总是出现错误,
- 比较弱的问题》》》》怎么能快速知道一个类属于哪个包?《《《
- 全世界的华人该醒醒了,看:“日本国土交通省将在冲之鸟礁设永久领土标志 ”
- 向股票行情的那些图是用java的那个组建画的?
- 强制类型转换(int)2.3和(int)2.9结果一样吗
- 高分求,如何用jbuilder6.0实现多窗口操作
- 帮看看这两行代码有什么问题
- 用什么集合类存储成对的信息最方便双向的检索?
- 两个JPanel的子类互相调用,出现空指针异常,谢谢!
- ResultSet的问题?
import java.io.*;
import java.awt.*;
import javax.servlet.*;
import javax.servlet.http.*;import Acme.JPM.Encoders.GifEncoder;public class HelloWorldGraphics extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
ServletOutputStream out = res.getOutputStream(); // binary output! Frame frame = null;
Graphics g = null; try {
// Create an unshown frame
frame = new Frame();
frame.addNotify(); // Get a graphics region, using the Frame
Image image = frame.createImage(400, 60);
g = image.getGraphics(); // Draw "Hello World!" to the off screen graphics context
g.setFont(new Font("Serif", Font.ITALIC, 48));
g.drawString("Hello World!", 10, 50); // Encode the off screen image into a GIF and send it to the client
res.setContentType("image/gif");
GifEncoder encoder = new GifEncoder(image, out);
encoder.encode();
}
finally {
// Clean up resources
if (g != null) g.dispose();
if (frame != null) frame.removeNotify();
}
}
}