Const WM_CAP As Integer = &H400
Const WM_CAP_DRIVER_CONNECT As Long = WM_CAP + 10
Const WM_CAP_DRIVER_DISCONNECT As Long = WM_CAP + 11
Const WM_CAP_EDIT_COPY As Long = WM_CAP + 30
Const WM_CAP_SET_PREVIEW As Long = WM_CAP + 50
Const WM_CAP_SET_PREVIEWRATE As Long = WM_CAP + 52
Const WM_CAP_SET_SCALE As Long = WM_CAP + 53
Const WS_CHILD As Long = &H40000000
Const WS_VISIBLE As Long = &H10000000
Const SWP_NOMOVE As Long = &H2
Const SWP_NOSIZE As Integer = 1
Const SWP_NOZORDER As Integer = &H4
Const HWND_BOTTOM As Integer = 1
Dim iDevice As Long ' Current device ID
Dim hHwnd As Long ' Handle to preview window
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hndw As Long) As Boolean
Private Declare Function capCreateCaptureWindowA Lib "avicap32.dll" _
(ByVal lpszWindowName As String, ByVal dwStyle As Long, _
ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, _
ByVal nHeight As Integer, ByVal hWndParent As Long, _
ByVal nID As Long) As Long
Private Declare Function capGetDriverDescriptionA Lib "avicap32.dll" (ByVal wDriver As Long, _
ByVal lpszName As String, ByVal cbName As Long, ByVal lpszVer As String, _
ByVal cbVer As Long) As Boolean
and all i see in picturebox
Code:
Sub OpenPreviewWindow()
'
' Open Preview window in picturebox
'
hHwnd = capCreateCaptureWindowA(iDevice, WS_VISIBLE Or WS_CHILD, 0, 0, 640, _
480, picCapture.hwnd, 0)
'
' Connect to device
'
If SendMessage(hHwnd, WM_CAP_DRIVER_CONNECT, iDevice, 0) Then
'
'Set the preview scale
'
SendMessage hHwnd, WM_CAP_SET_SCALE, True, 0
'
'Set the preview rate in milliseconds
'
SendMessage hHwnd, WM_CAP_SET_PREVIEWRATE, 66, 0
'
'Start previewing the image from the camera
'
SendMessage hHwnd, WM_CAP_SET_PREVIEW, True, 0
'
' Resize window to fit in picturebox
'
SetWindowPos hHwnd, HWND_BOTTOM, 0, 0, picCapture.ScaleWidth, picCapture.ScaleHeight, _
SWP_NOMOVE Or SWP_NOZORDER
cmdSave.Enabled = True
cmdStop.Enabled = True
cmdStart.Enabled = False
Else
'
' Error connecting to device close window
'
DestroyWindow hHwnd
cmdSave.Enabled = False
End If
End Sub
Создание видеоконференции.
Мне нужно сделать приложение видеоконференции. Я уже разобрался, как передавать данные по сети, но совершенно не могу придумать, как получать от web-камеры и микрофона информацию, чтоб передать ее по сети, а потом на машине получателе воспроизводить переданное. Может, кто то сталкивался с такой задачей или видел что то подобное?
Код:
Ключевые слова для поиска инфы в инете capCreateCaptureWindowA, WM_CAP_DRIVER_CONNECT, WM_CAP_SEQUNCE
спасибо!
для организации конференций использовать COM-API Microsoft NetMeeting: И сеть, и чат, и видео, и звук.
MSDN:
Цитата:
While connected on the Internet or corporate intranet, participants can communicate with both voice and video, work together on virtually any Windows-based application, exchange or mark up graphics on an electronic whiteboard, transfer files, or use the text-based chat program. For more information on Microsoft NetMeeting 2.0, see microsoft.com/windows/netmeeting/default.asp.
itbom.com/iAll/
ICQ 550183447
Ага,вот только тема более чем пятилетней давности.Увы,тогда ваше неумение было не востребовано,и вряд ли оно стало более востребовано сейчас