如何画“生化危机”带秋千
我正在为即将到来的测试练习我的挥杆能力,弗里德给了我画这样的生物危害标志的想法:
alt text http://img62.imageshack.us/img62/8372/lab6b.gif
我可以用 Elipse2D 绘制圆圈,但不知何故我需要切割这 3 个三角形。我有什么想法可以做到这一点吗?
I'm practicing my swing abilities for the upcoming test, and fried gave me idea to draw biohazard sign like this :
alt text http://img62.imageshack.us/img62/8372/lab6b.gif
I could draw the circles with Elipse2D, but then I somehow need to cut those 3 triangles. Any ideas how I can do that ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为此,您可以使用 Java2D 和 canvas。您可能使用的东西是圆和弧。您应该有三个 30 度的圆弧。
我尝试在框架上使用简单的图形。
这是一种尝试
原始的:源代码可以在 http://pastebin.com/HSNFx7Gq 找到
< a href="https://i.sstatic.net/WFySE.png" rel="nofollow noreferrer">
You can use Java2D and canvas for this. The things that you may be using are, Circle and Arc. You should have three arcs with 30 degrees.
I tried using simple graphics over the frame.
Here is an attempt
The original one : source code can be found at http://pastebin.com/HSNFx7Gq
您可以使用
Arc2D
类通过指定
start
和extent
参数(以度为单位)来绘制每条线。You can use the
Arc2D
class to draw each line by specifying thestart
andextent
parameters in degrees.也许这实际上很简单(我不确定 Swing API 如何处理线条)。从圆心到圆周上的点绘制线条,然后跳过这些部分进行线条绘制。
Maybe this is actually quite easy (I'm not sure how the Swing API handles lines). Draw lines coming out from the center to the points on the circumference of a circle, and just skip those portions for line drawing.