Created
August 9, 2015 05:06
-
-
Save razerdp/8e456509caf7b16e4524 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps:暂时来说我就这么有更新就写更新日志吧.....见谅 | |
新增方法: | |
DevToolsFactory.getBitmapTools().createBitmapWithAlphaMatte(Context context, Bitmap maskPic, Bitmap bgPic, boolean hasAlpha) | |
因为这个方法是对图片的像素进行操作,所以建议您将方法放到异步线程里面做,避免阻塞UI线程。Demo因为为了偷懒,所以就没有放到子线程里面做。。。。 | |
关于这个方法的参数如下: | |
Context context:上下文对象 | |
Bitmap maskPic:传入蒙板层的Bitmap | |
Bitmap bgPic:传入背景层的Bitmap | |
boolean hasAlpha:蒙板层是否含有Alpha(透明度通道),请注意这个,一定要区分好哦,一般而言,jpg不含alpha通道的,所以对于jpg请选择false,对于png,请注意看是否有alpha通道,辨别很简单,请右键您的图片,查看属性是否>24深度,因为ARGB=4*8=32位,而RGB=3*8=24位,所以请看准是否含有alpha通道哦 | |
方法返回的是一个合成好的bitmap,如果传入的bitmap为空,返回是空的哦,所以请判断一下是否返回空值,详情请看demo | |
以上。。。。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment