如何在VB中画指南针,请各位大哥帮助。 最好能给源码提示。谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 能不能详细一点? 是不是 画一个指南针图片? 那使用image 或者picturebox 就可以了 如果是简单的指针图形,算出坐标,用Line函数画就可以了,可以放在PictureBox里,移动的时候,设置PictureBox的DrawMode = 7,在原位置重画即可擦掉原图 给你源码,我做的是仪表,不过差不多.(在窗体上放个picturebox空间,我名称为picspeed,函数的参数是要转的角度.Private Sub YiBiao(ByVal lcs As Double)Dim x1 As Long, y1 As Long, x2 As Long, y2 As Long, x3 As Long, y3 As Long, x4 As Long, y4 As Long, temp As LongDim yuanpicSpeed.ScaleMode = 3picSpeed.AutoRedraw = TrueIf lcs < 0 Then lcs = 0If lcs > 180 Then lcs = 180lcs = lcs * 24 / 18 - 30x1 = picSpeed.ScaleWidth / 2y1 = picSpeed.ScaleHeight / 2x2 = x1 + picSpeed.ScaleHeight / 2.5 * Cos((180 + lcs) * 3.14 / 180)y2 = y1 + picSpeed.ScaleHeight / 2.5 * Sin((180 + lcs) * 3.14 / 180)x3 = x1 + picSpeed.ScaleWidth / 50 * Cos((90 + lcs) * 3.14 / 180)y3 = y1 + picSpeed.ScaleWidth / 50 * Sin((90 + lcs) * 3.14 / 180)x4 = x1 + picSpeed.ScaleWidth / 50 * Cos((270 + lcs) * 3.14 / 180)y4 = y1 + picSpeed.ScaleWidth / 50 * Sin((270 + lcs) * 3.14 / 180)picSpeed.ClsmidX = ((x3 + x4) / 2 + x2) / 2midY = ((y3 + y4) / 2 + y2) / 2picSpeed.Line (x2, y2)-(x3, y3), QBColor(10)picSpeed.Line (x2, y2)-(x4, y4), QBColor(10)picSpeed.Line (x3, y3)-(x4, y4), QBColor(10)picSpeed.Circle (x1, y1), picSpeed.ScaleWidth / 25, QBColor(8)picSpeed.FillColor = QBColor(8)ExtFloodFill picSpeed.hdc, x1, y1, picSpeed.Point(x1, y1), 1End Sub 有关VB操作word的几个小问题 在VB中怎么给ASP开发 组件? 利用vb开发的控件,如何在控件中点击按钮的时候打开一个新的ie页面? 如何读出域中的设置 关于SendKeys? 关于放midi的问题,请大虾指教 怎么得到操作系统的日期格式(YYYY-MM-DD)还是(YYYY-M-DD)?? 一个很简单的问题! VB还有前途吗? dbcombo 数据问题请指教~ 我是一个快要考试的人友很多简单的东西不知道你大家帮帮我.请帮我解释一下代码的意思 COM和COM+的主要区别是什么?请高手简要说下
Private Sub YiBiao(ByVal lcs As Double)
Dim x1 As Long, y1 As Long, x2 As Long, y2 As Long, x3 As Long, y3 As Long, x4 As Long, y4 As Long, temp As LongDim yuan
picSpeed.ScaleMode = 3
picSpeed.AutoRedraw = TrueIf lcs < 0 Then lcs = 0
If lcs > 180 Then lcs = 180
lcs = lcs * 24 / 18 - 30x1 = picSpeed.ScaleWidth / 2
y1 = picSpeed.ScaleHeight / 2
x2 = x1 + picSpeed.ScaleHeight / 2.5 * Cos((180 + lcs) * 3.14 / 180)
y2 = y1 + picSpeed.ScaleHeight / 2.5 * Sin((180 + lcs) * 3.14 / 180)
x3 = x1 + picSpeed.ScaleWidth / 50 * Cos((90 + lcs) * 3.14 / 180)
y3 = y1 + picSpeed.ScaleWidth / 50 * Sin((90 + lcs) * 3.14 / 180)
x4 = x1 + picSpeed.ScaleWidth / 50 * Cos((270 + lcs) * 3.14 / 180)
y4 = y1 + picSpeed.ScaleWidth / 50 * Sin((270 + lcs) * 3.14 / 180)
picSpeed.Cls
midX = ((x3 + x4) / 2 + x2) / 2
midY = ((y3 + y4) / 2 + y2) / 2
picSpeed.Line (x2, y2)-(x3, y3), QBColor(10)
picSpeed.Line (x2, y2)-(x4, y4), QBColor(10)
picSpeed.Line (x3, y3)-(x4, y4), QBColor(10)picSpeed.Circle (x1, y1), picSpeed.ScaleWidth / 25, QBColor(8)
picSpeed.FillColor = QBColor(8)ExtFloodFill picSpeed.hdc, x1, y1, picSpeed.Point(x1, y1), 1
End Sub