用VB画4个点的NURBS曲线参考代码
Dim p(10000, 1) As Double
Dim num As Integer
Dim ptx As Single
Dim pty As Single
Dim w0, w1, w2, w3 As Single
Private Sub Command1_Click()
Dim t As Single
Dim i As Integer
Dim f0, f1, f2, f3 As Single
Picture1.DrawWidth = 3
For t = 0 To 1 Step 1 / 1000
w0 = Val(Form1.Text1.Text)
w1 = Val(Form1.Text2.Text)
w2 = Val(Form1.Text3.Text)
w3 = Val(Form1.Text4.Text)
f0 = 1 / 6 * (-t ^ 3 + 3 * t ^ 2 - 3 * t + 1)
f1 = 1 / 6 * (3 * t ^ 3 - 6 * t ^ 2 + 4)
f2 = 1 / 6 * (-3 * t ^ 3 + 3 * t ^ 2 + 3 * t + 1)
f3 = 1 / 6 * (t ^ 3)
ptx = (f0 * p(0, 0) * w0 + f1 * p(1, 0) * w1 + f2 * p(2, 0) * w2 + f3 * p(3, 0) * w3) / (f0 * w0 + f1 * w1 + f2 * w2 + f3 * w3)
pty = (f0 * p(0, 1) * w0 + f1 * p(1, 1) * w1 + f2 * p(2, 1) * w2 + f3 * p(3, 1) * w3) / (f0 * w0 + f1 * w1 + f2 * w2 + f3 * w3)
Picture1.PSet (ptx, pty), vbRed
Next
Picture1.DrawWidth = 1
For i = 0 To num - 2
Picture1.Line (p(i, 0), p(i, 1))-(p((i + 1), 0), p((i + 1), 1)), vbGreen
Next
End Sub
Private Sub Command2_Click()
Dim i As Integer
For i = 0 To num - 2
Picture1.Line (p(i, 0), p(i, 1))-(p((i + 1), 0), p((i + 1), 1)), vbWhite
Next
For i = 0 To num
Picture1.Circle (p(i, 0), p(i, 1)), 40, vbWhite
相关文档:
VB隐藏进程问题的讨论由来已久,效果有好有坏,反正是各有各的招,偶然机会看到planet-source一段隐藏进程的文章,作者说采用了kernel mode driver!方法,
单从技术方法而言,这是目前见到隐藏进程中最强悍的了(个人见解,井底之蛙了),不过这种东西用在正义的人手上是一个除暴安良的利器,用心叵测者就不好说了,但是技术终归是技术 ......
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Sub Command1_Click()
Dim Url As String, Filepath As String
Url = "h ......
Option Explicit
Dim potflag As Integer '标识是否用小数点
Dim numcol As Integer ' 点击运算符的个数
Dim LastInput ' 指示上一次操作的内容
Dim colflag ......