Ç뽫ÒÔÏÂvb´úÂëÈçºÎдΪC#´úÂë лл
VB code:
Dim lpszName As New VBFixedStringAttribute(100)
Dim i As Integer
Dim DriverName As String = Space(80)
Dim DriverVersion As String = Space(80)
Dim bmp As BITMAPINFO
With bmp.bmiHeader
.biSize = Len(bmp.bmiHeader)
.biWidth = 320
.biHeight = 240
.biPlanes = 1
.biBitCount = 24
End With
i=0 'ÉãÏñÍ·ËùÔÚµÄ×éºÅ
capGetDriverDescriptionA(i, DriverName, 80, DriverVersion, 80)
lwndC1 = capCreateCaptureWindowA(DriverName, WS_VISIBLE Or WS_CHILD, 0, 0, PictureBox1.Width, PictureBox1.Height, PictureBox1.Handle.ToInt32, 0)
If capDriverConnect(lwndC1, 0) Then
capDlgVideoSource(lwndC1)
capPreviewRate(lwndC1, 66)
capPreview(lwndC1, True)
capSetVideoFormat(lwndC1, bmp, Len(bmp))
SetWindowPos(lwndC1, 0, 0, 0, bmp.bmiHeader.biWidth, bmp.bmiHeader.biHeight, SWP_NOMOVE Or SWP_NOZORDER)
ListBox1.Items.Add(DriverName.Trim)
End If
Function capDlgVideoSource(ByVal lwnd As Long) As Boolean
capDlgVideoSource = SendMessage(lwnd, WM_CAP_DLG_VIDEOSOURCE, 0, 0)
End Function
ÆäÖУº
Public Const WM_CAP_START As Integer = WM_USER
Public Const WM_CAP_DLG_VIDEOSOURCE As Integer = WM_CAP_START + 42
http://www.developerfusion.com/tools/convert/vb-to-csharp/
ÔÚÏßת»»
C# code
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlight
ÏÖÔÚÎÒÏë¸ù¾ÝtreeviewÉÏÿ¸ö½ÚµãµÄȨÏÞ£¬Ã»ÓÐȨÏ޵Ľڵ㲻Äܱ»Ñ¡ÖУ¬¶øÇҳɻÒÉ«£¬ÔõôʵÏÖ£¬ÔÚÏߵȡ£¡£¡£
Õâ¸ö£¿¡£¡£¡£
Ã²ËÆÃ»·¨¡£
ÊÔÊÔÄܲ»ÄܸÄijЩnodeµÄÑÕÉ«£¬¼Ç¼ÏÂÉϴεÄnodeclickÀïµÄnode¡£
Ï´εã»÷µÄÈç¹ ......
visual c++2008Ëٳɰ棬²»ÄܱàÒëC³ÌÐòÂð£¿Èç¹ûÄÜÊÇÔõô¿ªÊ¼µÄ°¡£¿ÓÃËü´øµÄÃüÁîÌáʾµ¥Ôª³ýÍâ ¡£
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆÌ¨£©
¾ø¶Ô¿ÉÒÔ¡£½¨Á¢win32¿ØÖÆÌ¨³ÌÐò¾Í¿ÉÒÔ
ÒýÓÃ
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆÌ¨£ ......