Hello, I have written some code to get a cropped image from the phone which I've tested and is working on both the Android emulator and on the G1 hardware. The behavior is different on the Motorola Droid so I could use some help figuring this out.
I'm creating an intent to get the cropped image with this code segment:
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
intent.putExtra("crop", "true");
intent.putExtra("outputX", width);
intent.putExtra("outputY", height);
intent.putExtra("aspectX", width);
intent.putExtra("aspectY", height);
intent.putExtra("scale", true);
intent.putExtra("noFaceDetection", true);
intent.putExtra("setWallpaper", false);
intent.putExtra("return-data", true);
I'm then calling startActivityForResult() passing the intent. This brings up the gallery browser on the phone alowing me to select an image and it will go into crop mode. This all works consistenlty across devices.
The difference is what happens after I've clicked Save after selecting my crop region. On the Motorola Droid it will simply return back to the gallery browser showing all the images.
The expected behavior and what happens in the emulator is my onActivityResult() is called where I then have the following code to grab the bitmap:
final Bundle extras = data.getExtras();
Bitmap bitmap = extras.getParcelable("data");
I'd appreciate any help as to the differences in the API and if there are changes I need to make to have this work on the Droid.
Thank you!
相关推荐
例如,`img = imread('Cropped_image.jpg')`会读取名为"Cropped_image.jpg"的图像文件,并将图像数据存储在变量`img`中。 `imcrop`函数则用于裁剪图像。它接受一个图像矩阵和一个矩形区域的坐标作为输入,返回指定...
A_cropped_image_dataset_for_Chinese_traffic_sign_c_TT100K_Cropped
这份文档的标题是“Ad Oculos Digital Image Processing_cropped2”,这表明文档是一本关于数字图像处理的教材,Ad Oculos很可能是该教材的名字或者是某种教学辅助工具。从目录内容可以判断,该教材详细地涵盖了数字...
$image->save('public/images/cropped_myimage.jpg'); ``` 这里裁剪了图片的50x50像素点为中心的200x200像素的区域。 Laravel 还提供了 Eloquent ORM 的关联方法,可以在处理上传图片时与数据库模型关联。例如,...
$image->save('public/images/cropped_example.jpg'); ``` **2.4 旋转图像** 使用 `rotate()` 方法可按角度旋转图像: ```php $image = Image::make('public/images/example.jpg')->rotate(90); $image->save('...
console.log('Cropped image data:', data); }, onUpload: function(dataURL) { // Upload cropped image to server uploadToServer(dataURL); } }); ``` ### 5. 注意事项 - 考虑到浏览器兼容性,确保...
wxPython GUI with ROI(crop) hover effect, also save main and cropped image with button (right or left click).
cropped_img.save('path_to_cropped_image.jpg') ``` 6. **动态调整大小**:根据描述,可能还会有根据用户需求动态调整裁剪尺寸的逻辑。这可能涉及到计算新尺寸,然后使用`thumbnail`或`resize`方法。 ```python...
cropped_img = img.crop((0, 0, img.width // 2, img.height // 2)) # 逆时针旋转90度 rotated_img = img.rotate(90, resample=Image.BICUBIC) ``` 这些只是图像处理的冰山一角。实际应用中,我们还可能涉及到更...
6. 可视化裁剪后的图像,`cv2.imshow('Cropped Image', cropped_img)`,并使用`cv2.waitKey()`等待用户按键,然后关闭窗口。 对于Apriori算法的实现,可能包括以下步骤: 1. 加载数据集,这可能来自图像的元数据...
裁剪图像 任何比例中心的裁剪图像 在 imageview 中,您只能使用CENTER-CROP (0.5,0.5) ,但它在 imageview 上显示图像的中心(0.5,... android : id = " @+id/iv_cropped_land_left " android : scaleType = " matrix
蛋白质的糖基化作用分类及相关数据库_cropped
UMIST(University of Manchester Image Database of Faces)是一个著名的人脸数据库,主要由英国曼彻斯特大学的研究团队创建,用于人脸识别领域的研究。这个数据库包含了1444张不同个体的脸部图像,这些图像由不同的...
img = Image.open('image.jpg') ``` 现在我们有了原始图片对象`img`,接下来就是切割的关键步骤。假设我们要将图片切成3行3列的网格,可以使用`img.crop()`方法。这个方法接受一个四元素的元组,表示矩形的左上角和...
hands mask of GTEA (with GTEA GAZE PLUS) ,1067 labeled frames, each frame of GTEA is 405x720, each frame of GTEA GAZE PLUS is 720x960.
cv2.imwrite('cropped_image.jpg', cropped_image) ``` 接下来,我们讨论图像的分块。当处理大尺寸图像时,为了提高效率和内存管理,我们可以将图像分割成多个小块。每个小块可以单独处理,然后再组合成整体。以下...
It returns an optionally scaled and/or cropped HTML img or canvas element. It also provides methods to parse image meta data to extract IPTC and Exif tags as well as embedded thumbnail images and to ...
cropped_img = img[y:y+height, x:x+width] ``` 6. **图像滤波**:OpenCV提供了各种滤波器,如高斯模糊、均值滤波和中值滤波,用于减小噪声或平滑图像: ```python blurred_img = cv2.GaussianBlur(img, ...
'/cropped_' . $info->getFilename(); Image::make($path)->fit(100, 100)->save($croppedPath); // 保存裁剪后的路径到数据库 // ... return success('上传成功', ['path' => $croppedPath]); } } ``` 在...
imagecopyresampled($cropped_image, $image, 0, 0, $x, $y, $width, $height, $width, $height); // 裁切 imagejpeg($cropped_image, 'uploads/cropped_' . basename($target_file)); // 保存裁切后的图片 ...