AccessControlException将图像转换为JPEG

时间:2012-08-10 14:58:06

标签: java

我在尝试将图片转换为JPEG时遇到了问题。我一直收到错误,说在FilePermission下拒绝访问。这是因为我的文件在我的计算机上设置的方式还是别的?这是代码 -

 BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);   
 Graphics g = image.getGraphics();   
 g.drawString("Hello World!!!", 10, 20);   
 try {    
   ImageIO.write(image, "jpg", new File("c:/CustomImage.jpg"));   
 } catch (IOException e) {    
  e.printStackTrace();   

提前致谢!

javascript squl squl-server

0 个答案:

没有答案