如何在vb6或vb.net中测量绘制的线长 [英] How to measure drawed line length in vb6 or vb.net

查看:305
本文介绍了如何在vb6或vb.net中测量绘制的线长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用vb 6或vb.net在英里计或厘米中测量绘制的线.但是有一个问题是我在拖曳bt之后得到了实际的x和y指针总数,这使我没有将以像素或缇为单位的x和y坐标总数混淆了.

所以任何人都可以告诉我如何测量拖线长度

I m trying to measure the drawed line in mili meter or centi meter using vb 6 or vb.net. but there is the problem is i get the actual x and y pointers total at the draging bt after this i m confuse the total no x and y cordinates in pixels or twips

so any can tell me how can i measure the draging line length

推荐答案

我想您在vb.net中使用了图形对象
在这种情况下,您可以设置测量单位
例子

Dim G BufferedGraphics = BufferedGraphicsManager.Current.Allocate(Me.CreateGraphics,Me.ClientRectangle)

G.Graphics.PageUnit = GraphicsUnit.Display
''或
g.Graphics.PageUnit = GraphicsUnit.Millimeter
''或
G.Graphics.PageUnit = GraphicsUnit.Pixel

''画完线后

G.Graphics.DrawLine
I suppose you use graphics objects in vb.net
In this case you will able to set the measurement unit
Example

Dim G As BufferedGraphics = BufferedGraphicsManager.Current.Allocate(Me.CreateGraphics, Me.ClientRectangle)

G.Graphics.PageUnit = GraphicsUnit.Display
''or
g.Graphics.PageUnit = GraphicsUnit.Millimeter
''Or
G.Graphics.PageUnit = GraphicsUnit.Pixel

''After you draw your line

G.Graphics.DrawLine


这篇关于如何在vb6或vb.net中测量绘制的线长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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