
我是如何实现这一目标的
Path path = new Path(); // Multiple path methods to create shape of puzzle pIEce... path.close(); Bitmap source = BitmapFactory.decodeResource(getResources(),R.drawable.flowers); Bitmap workingcopy = source.copy(Bitmap.Config.ARGB_8888,true); Canvas canvas = new Canvas(workingcopy); path.setFillType(Path.FillType.INVERSE_WINDING); Paint paint = new Paint(); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)); canvas.drawPath(path,paint); ((ImageVIEw) findVIEwByID(R.ID.myImage)).setimageBitmap(workingcopy);
我希望我可以让它透明而不是黑色,并切除路径范围之外的一切.
解决方法 我尝试使用具有透明度的PNG文件,背景是透明的而不是黑色. @H_502_25@ 总结以上是内存溢出为你收集整理的android – 使用Path剪切带有Bitmap的区域全部内容,希望文章能够帮你解决android – 使用Path剪切带有Bitmap的区域所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)