绘制并附加到双水平线

发布于 2024-09-25 01:32:25 字数 317 浏览 0 评论 0原文

我知道如何在 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?

Blue Horizontal Line

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幸福%小乖 2024-10-02 01:32:25

您可以在任何Control 上实现onPaint 事件,然后在传递的图形对象上手动进行绘制。

You can implement the onPaint event on any Control and then do the drawing manually on the passed graphics object.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文