简体   繁体   English

从png,Android创建圆形图像

[英]create a circular image from a png, android

Given an image file (png) I would like to specify the coordinates within the image for the center of a circle and the radius and have the routine cut out that circle and display the new image. 给定一个图像文件(png),我想在图像内为圆心和半径指定坐标,并让例程切出该圆并显示新图像。 I have looked at ShapeDrawable but that only seems to do a single color using a Paint attribute. 我已经看过ShapeDrawable,但是使用Paint属性似乎只能做一种颜色。 The other drawing classes also seem to use Paint but I can't figure out how to use an image for the background of a drawn cirle. 其他绘图类似乎也使用Paint,但是我不知道如何在绘制的背景中使用图像。 thanks much 非常感谢

Take a look at xferModes. 看一下xferModes。 I think there are some good examples in the api-demos. 我认为api-demos中有一些很好的例子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM