发布网友 发布时间:2022-04-19 23:45
共1个回答
热心网友 时间:2023-09-26 06:27
把PNG格式的文件解析成BYTE数组然后再组合成JPGbyte[] b=null;File PNG = null;BufferedOutputStream stream = null;try {PNG = new File(outputFile);FileOutputStream fstream = new FileOutputStream(PNG);stream = new BufferedOutputStream(fstream);stream.write(b);} catch (Exception e) {// log.error("helper:get file from byte process error!");e.printStackTrace();} finally {if (stream != null) {try {stream.close();} catch (IOException e) {// log.error("helper:get file from byte process error!");e.printStackTrace();}}}Bitmap bitmap=BitmapFactory.decodeByteArray(b, 0, b.length);擦..发现自己弄的是BMP格式..反正就这样差不多了..