我刚刚完成了我的相机活动,它可以很好地保存数据.拍摄照片后我做了什么:
protected void savePictureData() {
try {
FileOutputStream fs = new FileOutputStream(this.photo);
fs.write(this.lastCamData);
fs.close(); //okay, wonderful! file is just written to the sdcard
//---------------------
//---------------------
//TODO in here: dont save just the file but ROTATE the image and then save it!
//---------------------
//---------------------
Intent data = new Intent(); //just a simple intent returning some data...
data.putExtra("picture_name", this.fname);
data.putExtra("byte_data", this.lastCamData);
this.setResult(SAVED_TOOK_PICTURE, data);
this.finish();
} catch (IOException e) {
e.printStackTrace();
this.IOError();
}
}
Run Code Online (Sandbox Code Playgroud)
我想要的是已经在上面的代码中给出的评论.我不希望将图像保存到文件中,但要旋转然后保存!谢谢!
// 编辑:我目前正在做什么(工作但仍会遇到大图像的内存问题)
byte[] pictureBytes;
Bitmap thePicture = …Run Code Online (Sandbox Code Playgroud) 我得到了一个相对定位的布局.在其中我(现在)有两件事:
虽然LinearLayout覆盖了按钮,但按钮仍然是可点击的.即使叠加层中有另一个按钮.
我怎么能避免这个?