【问题标题】:Android: clip image to shapeAndroid:将图像剪辑到形状
【发布时间】:2011-07-20 10:15:03
【问题描述】:
(对不起我的英语不好)
我有两张照片。一张照片色彩鲜艳,很大。在另一张图片上,透明背景上显示了一个任意形状的黑色图形(如十字或星形或经典拼图的一块)。
我想将第二张图片放在第一张图片上,并用第一张图片的一部分替换黑色。然后我需要将第二个图像保存在一个新文件中。
谢谢。
最大。
【问题讨论】:
标签:
android
image
graphics
shape
clip
【解决方案1】:
您可以通过使用库和单行代码来获得它。
请试试这个,希望你能得到更好的解决方案。
dependencies {
compile 'com.mafstech.libs:mafs-image-shape:1.0.4'
}
而这一行是你的主要代码
Shaper.shape(context, R.drawable.your_original_image_which_will_be_displayed, R.drawable.shaped_image__your_original_image_will_get_this_images_shape, imageView, height, weight);