小编and*_*vid的帖子

安装前Android旋转图片

我刚刚完成了我的相机活动,它可以很好地保存数据.拍摄照片后我做了什么:

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)

io camera android image file

11
推荐指数
2
解决办法
2万
查看次数

当另一个布局覆盖它时,为什么按钮可以点击?

我得到了一个相对定位的布局.在其中我(现在)有两件事:

  • 一个可点击按钮,它绑定到onClick-Event
  • 一个覆盖整个屏幕的LinearLayout

虽然LinearLayout覆盖了按钮,但按钮仍然是可点击的.即使叠加层中有另一个按钮.

我怎么能避免这个?

layout android onclick android-linearlayout

3
推荐指数
1
解决办法
3594
查看次数

标签 统计

android ×2

android-linearlayout ×1

camera ×1

file ×1

image ×1

io ×1

layout ×1

onclick ×1