我的意思是图片大小有什么限制,难道可以无限大吗?
我的长度最多只能到65000像素。
有没有计算的方法???

解决方案 »

  1.   

    我的内存是512M。
    我是这样做的:
    image = new BufferedImage((int)imageWidth, (int)imageHeight, BufferedImage.TYPE_INT_RGB); 
    graphics = image.getGraphics();
    然后在对graphics对象进行操作:如画线等等
    最后生产jpg文件:FileOutputStream fos = new FileOutputStream(fileLocation);
          BufferedOutputStream bos = new BufferedOutputStream(fos);
          JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bos);
          encoder.encode(image);