2012-06-21 28 views
2

在图像中,您可以显示已修复的帧。我想裁剪图像的一部分只显示在框架的透明区域。所以如何找到一个框架的透明区域?以及如何才能获得只显示在透明区域的背后图像......?任何哥们知道的话请让我现在... 提前感谢你花费你的时间和精力成为一个问题。如何裁剪只显示在transperant区域的图像?

enter image description here

+1

为什么不你只是参加一个FrameLayout里ImageViews并置于另一层之上,保持研究背景的ImageView和帧图像,你只是想表明像上述卡上imageview..if照片.. ! – MKJParekh

+0

我们已经试过这个,但它的工作原理是,我们想要在虚线形内裁剪所以我怎么能做到这一点。 –

+0

好吧,我知道有一个开放的项目需要裁剪,但它可以做到这一点,就像我们可以在defaul画廊应用中做的那样。但是这是类似于“Photoshop的魔法工具” – MKJParekh

回答

0

这里只是我们采取相对布局之间的两个图像视图。第一帧(在快照中的图像视图之上)被修复,并且在按钮点击监听器上我们在框架后面调整了第二个图像,这是一个简单的逻辑。并不复杂。

但主要的是我们想要透明区域的框架。这里的帧不像上面的截图一样,但是无论如何,像我预先声明的那样裁剪它(一帧透明部分)并将其放置在另一个图像中。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:orientation="vertical" > 

<Button 
    android:id="@+id/Button01" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Browse gallery" > 
</Button> 
<ImageView 
    android:id="@+id/ImageView01" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_below="@+id/Button01" 
    > 
</ImageView> 

<ImageView 
    android:id="@+id/ImageView" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/Button01" 
    android:background="@drawable/frame" > 
</ImageView>