在Droid X的裁剪画面设置生成的图像为墙纸 [英] Cropping Picture on Droid X sets resulting image as wallpaper

查看:179
本文介绍了在Droid X的裁剪画面设置生成的图像为墙纸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行到一个问题,我的程序试图裁剪从他们自己的相册用户选择图像时。这个问题至今只在Droid X的运行时,如在原来的摩托Droid的工作正常运行的出现。

I'm running into an issue with my program when trying to crop an image selected by the user from their gallery. The issue so far only appears when running on a Droid X, as running on the original moto Droid works fine.

基本上出现了问题,因为种植意向正在运行。一旦用户裁剪照片并点击保存按钮,它取代了壁纸与保存的裁剪图像的主屏幕上!它不会对摩托罗拉的Droid,或仿真器做到这一点。下面是code进行裁剪并保存图片到SD卡:

Basically the issue occurs as the cropping intent is being run. Once the user crops the photo and clicks the save button, it replaces the wallpaper on the main screen with the cropped image that was saved! It does not do this on the moto droid, or emulators. Below is the code for cropping and saving the picture to the SD card:

@Override
public void onActivityResult(int requestCode,int resultCode,Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode ==1){
if (resultCode == Activity.RESULT_OK) {
  Intent i = new Intent("com.android.camera.action.CROP");
  i.setData(data.getData());
  i.putExtra("noFaceDetection", true);
  i.putExtra("outputX", 80);
  i.putExtra("outputY", 80);
  i.putExtra("aspectX", 1);
  i.putExtra("aspectY", 1);
  i.putExtra("scale", true);


if(selectedImageString == null){
      ContentValues values = new ContentValues();
      values.put(android.provider.MediaStore.Images.Media.TITLE, "Temp_Icon1");
      values.put(android.provider.MediaStore.Images.Media.BUCKET_ID, "Temp_Icons");
      values.put(android.provider.MediaStore.Images.Media.BUCKET_DISPLAY_NAME,"Temp_Icons");
      values.put(android.provider.MediaStore.Images.Media.IS_PRIVATE, 1);
      selectedImageString = getContentResolver().insert(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values).toString();
  }
  i.putExtra("output", Uri.parse(selectedImageString));
  startActivityForResult(i, 2);
}
}
 if(requestCode == 2){
 if (resultCode == Activity.RESULT_OK){
  uriPath = Uri.parse(selectedImageString);
  imageView.setImageURI(uriPath);
 }
}

}

是否有人可以帮助我?

推荐答案

我可以验证在Droid X在做同样的对我来说即使有上面​​提到的输出选项。我发现没有办法解决它作为然而,并期待在阻塞Droid X的电话的裁剪功能为好。据羞愧不会在这里工作。

I can verify that the Droid X is doing the same for me even with the "output" option mentioned above. I have found no way around it as of yet and will look at blocking the crop feature for Droid X phones as well. It is ashame it doesn't work here.

通过他们的方式,你可以尝试以下...

By they way, you could try the following...

i.putExtra("return-data", true);

这将返回在返回的意图的图像。你可以用下面的访问...

This returns the image in the returned intent. You can access it with the following...

BitMap BM = data.getParcelableExtra("data");

然而,这不是由Galaxy S的线电话的支持。它返回一个空包裹不管。所以,我发现没有什么好办法呢。

This, however, is not supported by the Galaxy S line of phones. It returns an empty parcel no matter what. So, I have found no good solution yet.

这篇关于在Droid X的裁剪画面设置生成的图像为墙纸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆