Android的可调整大小的矩形作物矩形、作物、可调整、大小

2023-09-04 07:21:59 作者:謸氕づ独尊

我需要使用基于用户的触摸事件可调整大小的矩形裁剪图片。我完全被困在这里。我这样做是因为裁剪意图功能不支持的所有设备(所以创造我自己的)

I need to crop a picture using a resizeable rectangle based on user touch events. I'm completely stuck here. I'm doing this because the crop intent feature isn't supported by all devices (So creating my own)

我有原来的图像作为位图,它的屏幕上显示为一个图像视图。

I have the original image as a bitmap and it's displayed on the screen as an image view.

现在我需要做的就是旁边有一个矩形(已经知道大小它需要),可以调整大小和移动的裁剪图像的用户(说得到一个面)。

Now what I need to do next is have a rectangle (already know size it needs to be) that can be resized and moved for the user to crop the image (Say get a face).

有谁知道这个简单的教程? (不是code一个极大线),或者甚至是code?

Does anyone know a simple tutorial on this? (not a gazillion lines of code) or even the code?

也就是有可能实现另一种自给自足的作物类或库(我是相当新的Andr​​oid的)。

Also is it possible to implement another self contained crop class or library (I'm fairly new to Android).

推荐答案

CropImage 一直对我太好了。