简体   繁体   English

绘制波浪线

[英]Draw a wave line

I'm trying to make a copy of the bubble trouble game in C#. 我正试图在C#中制作一个泡泡麻烦游戏的副本。 I need to create the game in windows form application. 我需要在Windows窗体应用程序中创建游戏。

I use Graphics for the drawing. 我使用Graphics作为绘图。 In the bubble trouble original game the arrow is moving like wave, and not a straight line and i can't figure out how to do this. 在泡沫问题原始游戏中,箭头像波浪一样移动,而不是直线,我无法弄清楚如何做到这一点。

There is a way to do that in windows form application somehow? 有一种方法可以在Windows窗体应用程序中以某种方式执行此操作吗? And if there is a way ,please explain me how to do that. 如果有办法,请解释我该怎么做。

Thank you, Asaf. 谢谢你,阿萨夫。

Create a brush as follows 按如下方式创建画笔

Brush zigzagBrush = new System.Drawing.Drawing2D.HatchBrush(System.Drawing.Drawing2D.HatchStyle.ZigZag, Color.Black);

You can then draw the line using the above brush 然后,您可以使用上面的画笔绘制线条

Use: 采用:

this.createGraphics.drawLines(new Point[]{});

where the point array contains your line corners. 点数组包含线角的位置。

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

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