易截截图软件、单文件、免安装、纯绿色、仅160KB

用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与FTP编程

Option Explicit
Private Const INTERNET_OPEN_TYPE_DIRECT = 1
Private Const scuseragent = "vb wininet"
Private Const INTERNET_FLAG_PASSIVE = &H8000000
'调用设置环境
Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long ......

VB操作WORD

 Dim wdapp As Word.Application
    Dim wddoc As Word.Document
    Dim wdtable As Word.Table
   
    Set wdapp = CreateObject("word.application")
   
    Set wddoc = wdapp.Documents.Add
   ......

vb用api调用对话框

建一个模块
Public Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Public Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilt ......

vb程序中webbrowser 接受SendMessage 的消息

webbrowser 不能收到SendMessage的消息
主要是因为1webbrowser 的句柄找不到。经过努力搜索,终于解决了。做个记录.
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号