2012-04-23 87 views
0

我遇到了一个问题,保存和加载图片在Android(图片对象)。这是我写入内部存储器的代码(我不确定它是否正常工作):Android写作/阅读图片到内部存储

  FileOutputStream fos = null; 
      Picture l0 = new Picture(); 
      fos = openFileOutput("layer0", Context.MODE_PRIVATE); 
      InputStream is = new ByteArrayInputStream(layer0.getBytes()); 
      SVG svg = SVGParser.getSVGFromInputStream(is); 
      l0 = svg.getPicture(); 

      l0.writeToStream(fos); 
      fos.close(); 

我该如何读取此图像?请检查这种存储方式。干杯。

回答

0

使用功能createFromStream

喜欢的东西:

Picture myPic = Picture.createFromStream(openFileInput("layer0"));