我知道有一个包可以是免费的,你想要的话我给你发过去,至于向数据库中插,很简单流操作就行。包名:Acme,能把你applet的源代码给我一份吗,我现在正在搞这个,我是用的servlet。
email:[email protected]

解决方案 »

  1.   

    这是个简单问题,比如在一个panel p中:先import:import com.sun.image.codec.jpeg.*;
    import java.awt.image.*;
    import sun.awt.image.codec.JPEGImageEncoderImpl;然后:
               //save a jpeg               BufferedImage offScreen = new BufferedImage((int)p.getWidth(),
                            p.getHeight(),BufferedImage.TYPE_INT_RGB);                    Graphics g = offscreen.getGraphics();
                        p.paint((Graphics2D)g);                   FileOutputStream jpgFile = new FileOutputStream("picture.jpg");
                       JPEGImageEncoderImpl jpeg = new JPEGImageEncoderImpl(jpgFile);
                       jpeg.encode(offScreen);
                       jpgFile.close();
    齐活!
      

  2.   

    偶对不起,保存的是jpg!!!!!
    严重道歉。
      

  3.   

    哦,jpg也行啊!!!!!!!!这就好办了。
    把FileOutputStream jpgFile = new FileOutputStream("picture.jpg");改为字节流,然后
    把这个字节流保存到数据库的相应子段不就齐活了!!!!!!
      

  4.   

    怎么说找不到encode方法?我用的是JBuilder7,难道没有?