开发者

How can I make a crescent shape?

开发者 https://www.devze.com 2023-01-18 22:42 出处:网络
I want think make a crescent shape, and I was thinking of overlapping a fillArc over another fillArc, but I do not want that because the top layer would not 开发者_JAVA百科be transparent. Is there any

I want think make a crescent shape, and I was thinking of overlapping a fillArc over another fillArc, but I do not want that because the top layer would not 开发者_JAVA百科be transparent. Is there any other way?


Check the following link out: Clipping

(It references an instance of Graphics2D, but Graphics uses the same idea.)

Use setClip(Shape shape)with an Ellipse shape. The clip area is where graphics will not be drawn after the clip is set. Then use a single call of fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) to draw your crescent shape.

0

精彩评论

暂无评论...
验证码 换一张
取 消