C#在特定位置画一条线. [英] C# Drawing a line in a specific place.

查看:361
本文介绍了C#在特定位置画一条线.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在面板上用C#画线的帮助.但是,它的工作原理是,您需要能够将图片放置在面板上,然后将图片放置在面板上时,我需要能够从该图片的中心向下方绘制一条线.用户移动他/她的鼠标...

我知道如何放置图片框,也知道如何绘制线条,问题在于图片框和线条都在面板上使用鼠标坐标和鼠标移动事件.我认为是什么弄糟了.

有人可以通过提出一些建议来帮助我吗?谢谢.

Hi I need help with drawing of a line in C# on a panel. However how it must work is, you need to be able to place a picture on a panel then when that picture is placed on the panel, I need to be able to draw a line from the center of that picture to as far down as the user moves his/her mouse...

I know how to place the picture box and I also know how to draw lines, the problem comes in with the fact that both the picture box and the line are using mouse co-ordinates and mouse movement events on the panel. Which I think is what is messing it up.

Can someone maybe help me by giving some sort of suggestion as to how I can go about drawing this line? Thanks.

推荐答案

您好,Storxstar,

我用它在表格上画线: Visual Basic Powerpacks 3.0 [ ^ ].下载它,将其添加到工具栏,然后使用LineShape工具在表单上绘制线条.

但是,您将无法创建从绘制直线的表格衍生而来的新表格.但是,如果您不需要从中派生任何形式,那将是一个完美的解决方案!
Hi Storxstar,

I used this one to draw lines on a form: visual Basic Powerpacks 3.0[^]. Download it, add it to your toolbar, and use the LineShape tool, to draw lines on your form.

However, you won''t be able to create a new form derived from the form on which you drew the line. But if you don''t need to derive any forms from it, it''s a perfect solution!


这篇关于C#在特定位置画一条线.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆