绘制并附加到双水平线
我知道如何在 C# 中绘制直线,但我想用两种颜色绘制一条水平线。顶部为浅蓝色,底部为深蓝色。另外,我该如何...附加到该行?例如,每隔几秒钟,该线就会变得更大......就像进度条一样。 (顺便说一句,我没有创建 ProgressBar,只是使用它作为示例)。
这就是我想要画的线。我知道我可以简单地使用 PictureBox。但我想开始画画!
另外,如果除了 GDI 或 GDI+ 之外还有其他绘图方式,您能否列出或链接到这些方式?
谢谢!
I know how to draw straight lines in C#, but I would like to draw a horizontal line, with two colors. Light blue on the top, and dark blue on the bottom. Also, how would I sort of... Append to that line? For example, every few seconds, that line will become bigger... like a ProgressBar. (btw, I'm not creating a ProgressBar, just using that as an example).
Here's the kind of line that I'd like to draw. I am aware that I can simply use PictureBox. But I want to start drawing!
Also, if there are other ways of drawing, than GDI or GDI+, could you list or link to those?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在任何
Control
上实现onPaint
事件,然后在传递的图形对象上手动进行绘制。You can implement the
onPaint
event on anyControl
and then do the drawing manually on the passed graphics object.