Raj*_*Raj 5 android crop imageview android-imageview
嗨,我想在不移动叠加视图的情况下裁剪图像而不是移动图像。

图像可以四处移动。我想裁剪并保存突出显示的区域,如下所示在黑色边框内。
我有ImageView与android:scaleType="matrix"
这是我的布局代码
<RelativeLayout
android:id="@+imageEdit/rl_ScaleImage"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_below="@+imageEdit/Topbar"
android:visibility="visible" >
<ImageView
android:id="@+imageEdit/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:scaleType="matrix" />
<View
android:id="@+imageEdit/viewTop"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:background="#99000000" />
<View
android:id="@+imageEdit/view_scaledImage"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+imageEdit/viewBottom"
android:layout_below="@+imageEdit/viewTop"
android:background="@drawable/rounded_corner_small" />
<View
android:id="@+imageEdit/viewBottom"
android:layout_width="fill_parent"
android:layout_height="150dp"
android:layout_alignParentBottom="true"
android:background="#99000000" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
ImageView有OnTouchListener. 图像可以放大或缩小,也可以移动ImageView1。Viewview_scaledImage是我想要裁剪和保存的区域。我该怎么做呢?
| 归档时间: |
|
| 查看次数: |
5442 次 |
| 最近记录: |