如何解决使用FileOutputStreamAndroid-Java在活动中移动位图时如何不丢失数据?
我目前正在使用Java和android进行隐写术应用程序,并且我找不到通过活动移动大型位图而不丢失图像中隐藏消息的正确方法。为什么在活动中移动位图时会发生变化?
第一次活动:
String filename = "bitmap";
FileOutputStream stream = this.openFileOutput(filename,Context.MODE_PRIVATE);
bitmap.compress(Bitmap.CompressFormat.PNG,100,stream);
stream.close();
Intent intent = new Intent(this,save_image.class);
startActivity(intent);
第二个活动,接收到位图:
try {
bitmap = BitmapFactory.decodeStream(this.openFileInput("bitmap"));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。