gpt4 book ai didi

android - 如何更改SquareCamera库的目录?

转载 作者:行者123 更新时间:2023-11-30 01:50:59 25 4
gpt4 key购买 nike

我正在使用 SquareCamera 库 ( https://github.com/boxme/SquareCamera ) 拍摄方形照片。我面临的问题是 SquareCamera 正在创建自己的文件夹,用于存储拍摄的照片。我希望这些照片存储在我自己的文件夹中。我不知道如何实现这一目标。我对安卓很陌生。下面是我调用它自己的类而不是默认相机的代码。

public void onLaunchCamera(View view) {
// create Intent to take a picture and return control to the calling application
Intent intent = new Intent(this,CameraActivity.class);
// Start the image capture intent to take photo
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);

这是 onActivityResult 方法

public void onActivityResult(int requestCode, int resultCode, Intent data) {

if (requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE) {
if (resultCode == RESULT_OK) {
Uri takenPhotoUri = data.getData();
Bitmap takenImage = BitmapFactory.decodeFile(takenPhotoUri.getPath());
imageView.setImageBitmap(takenImage);

我想把这张位图保存到我自己的文件夹中,但我想不出如何删除 SquareCamera 创建的目录。

最佳答案

所以我找到了解决方案。我将库作为模块添加到我的应用程序中。引用 ( https://www.youtube.com/watch?v=1MyBO9z7ojk )。然后我稍微更改了源代码,现在它运行完美了。

关于android - 如何更改SquareCamera库的目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33053593/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com