hhhp2004
Messages postés173Date d'inscriptionsamedi 25 octobre 2003StatutMembreDernière intervention13 octobre 2007
-
29 janv. 2005 à 21:46
cs_webooking
Messages postés17Date d'inscriptionlundi 18 juillet 2005StatutMembreDernière intervention18 juillet 2005
-
18 juil. 2005 à 13:54
hhhp2004
salut, je viens de finir un prog de chat et je me demandais si je peux faire en sorte que les 2 utilisateur puissent parler (au micro) et se voir (webcam)
Si cest possible, indiquez moi svp par ou commencer ...
olivier857
Messages postés188Date d'inscriptionmardi 21 décembre 2004StatutMembreDernière intervention10 avril 2008 30 janv. 2005 à 17:41
Voila déja un point de depart :
Avec ca devrais avoir un peu près tout ce qu'il te faut pour gérer l'envoie et la reception de l'image + un bouton pour capturer l'image.
<code>
Option Explicit
'Déclaration des fonctions pour le traitement des fichiers graphiques
Private Declare Function BmpToJpeg Lib "Bmp2Jpeg.dll" (ByVal BmpFilename As String, ByVal JpegFilename As String, ByVal CompressQuality As Integer) As Integer
Private Declare Function BitBlt Lib "gdi32.dll" (ByVal hdcDest As Long, ByVal nXDest As Long, ByVal nYdest As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hdcSrc As Long, ByVal nXSrc As Long, ByVal nYSrc As Long, ByVal dwRop As Long) As Long
'déclaration des fonctions pour la capture de l'image de la caméra
Private Declare Function capCreateCaptureWindow Lib "avicap32.dll" Alias "capCreateCaptureWindowA" (ByVal IpszWindowName As String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hwndParent As Long, ByVal nID As Long) As Long
Private Declare Function SendMessage Lib "USER32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, IParam As Any) As Long
Private Declare Function ReleaseCapture Lib "USER32" () As Long
'Déclaration des constantes
Private Const WM_CAP_DRIVER_CONNECT As Long = 1034
Private Const WM_CAP_DRIVER_DISCONNECT As Long = 1035
Private Const WM_CAP_GRAB_FRAME As Long = 1084
Private Const WM_CAP_EDIT_COPY As Long = 1054
Private Const WM_CAP_DLG_VIDEOFORMAT As Long = 1065
Private Const WM_CAP_DLG_VIDEOSOURCE As Long = 1066
Private Const WM_CLOSE = &H10
'Déclaration des variables nécessaires à l'utilisation des fonctions précédentes
Private mCapHwnd As Long
'Déclaration des variables pour le stockage mémoire des images
Dim ImageWebCam() As Byte
Private Sub Form_Load()
socklisten.LocalPort = 128
socklisten.Listen
'dimensionnement dynamique de l'objet MaWebCam en fonction de la taille de l'image
MaWebCam.Width = 640 * Screen.TwipsPerPixelX
MaWebCam.Height = 480 * Screen.TwipsPerPixelY
'fenêtre virtuelle
mCapHwnd = capCreateCaptureWindow("Ma fenêtre de capture", 0, 0, 0, 320, 240, Me.hwnd, 0)
SendMessage mCapHwnd, WM_CAP_DRIVER_CONNECT, 0, 0
End Sub
Private Sub Camera_Click()
Timer.Enabled = True
End Sub
Private Sub Capture_Click()
'Pour cette ligne il te faut avoir la dll bmp2jpeg
BmpToJpeg App.Path & "\tmpout.bmp", App.Path & "\tmpout.jpeg", 40
MsgBox "Cliquez sur OK pour enregistrer l'image", vbOKOnly
SavePicture MaWebCam, "tmpout.bmp"
End Sub
Private Sub socklisten_ConnectionRequest(ByVal requestID As Long)
sockclient.Accept requestID
End Sub
Private Sub Setting_Click()
SendMessage mCapHwnd, WM_CAP_DLG_VIDEOFORMAT, 0, 0
End Sub
Dim FREEout As Integer
FREEout = FreeFile
Open App.Path & "\tmpout.jpg" For Binary As #FREEout
ReDim ImageWebCam(1 To LOF(FREEout))
Get #FREEout, , ImageWebCam
Close #FREEout
End Sub
Private Sub sock_DataArrival(ByVal bytesTotal As Long)
Dim ImageWebcamDistante() As Byte
Dim FREEin As Integer
Winsock.GetData ImageWebcamDistante
If Dir$(App.Path & "\tmpin.jpg") <> "" Then Kill App.Path & "\tmpin.jpg"
FREEin = FreeFile
Open App.Path & "\tmpin.jpg" For Binary As #FREEin
Put #FREEin, , ImageWebcamDistante
Close #FREEin
webcamdistance.Picture = LoadPicture(App.Path & "\tmpin.jpg")
webcamdistance.distance.Refresh
DoEvents
End Sub
Private Sub Form_Unload(Cancel As Integer)
SendMessage mCapHwnd, WM_CAP_DRIVER_DISCONNECT, 0, 0
End Sub
<\code>
Dim FREEout As Integer
FREEout = FreeFile
Open App.Path & "\tmpout.jpg" For Binary As #FREEout
ReDim ImageWebCam(1 To LOF(FREEout)) 'il y a une erreur sur cette 'ligne, "Subscript out of range"
Get #FREEout, , ImageWebCam
Close #FREEout
olivier857
Messages postés188Date d'inscriptionmardi 21 décembre 2004StatutMembreDernière intervention10 avril 2008 30 janv. 2005 à 22:35
Tiens essaye deja ca c'est plus simple, mais ca te permet uniquement de regarder ta webcam a toi sur ton pc.
Ca t'aiderai a mieux comprendre, tu passera a la suite après.
Option Explicit
'Déclaration des fonctions pour le traitement des fichiers graphiques
Private Declare Function BmpToJpeg Lib "Bmp2Jpeg.dll" (ByVal BmpFilename As String, ByVal JpegFilename As String, ByVal CompressQuality As Integer) As Integer
Private Declare Function BitBlt Lib "gdi32.dll" (ByVal hdcDest As Long, ByVal nXDest As Long, ByVal nYdest As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hdcSrc As Long, ByVal nXSrc As Long, ByVal nYSrc As Long, ByVal dwRop As Long) As Long
'déclaration des fonctions pour la capture de l'image de la caméra
Private Declare Function capCreateCaptureWindow Lib "avicap32.dll" Alias "capCreateCaptureWindowA" (ByVal IpszWindowName As String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hwndParent As Long, ByVal nID As Long) As Long
Private Declare Function SendMessage Lib "USER32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, IParam As Any) As Long
Private Declare Function ReleaseCapture Lib "USER32" () As Long
'Déclaration des constantes
Private Const WM_CAP_DRIVER_CONNECT As Long = 1034
Private Const WM_CAP_DRIVER_DISCONNECT As Long = 1035
Private Const WM_CAP_GRAB_FRAME As Long = 1084
Private Const WM_CAP_EDIT_COPY As Long = 1054
Private Const WM_CAP_DLG_VIDEOFORMAT As Long = 1065
Private Const WM_CAP_DLG_VIDEOSOURCE As Long = 1066
Private Const WM_CLOSE = &H10
'Déclaration des variables nécessaires à l'utilisation des fonctions précédentes
Private mCapHwnd As Long
'Déclaration des variables pour le stockage mémoire des images
Dim ImageWebCam() As Byte
hhhp2004
Messages postés173Date d'inscriptionsamedi 25 octobre 2003StatutMembreDernière intervention13 octobre 2007 31 janv. 2005 à 00:02
hhhp2004
salut,
jai deja modifier le code pour regarder la webcam juste sur mon pc, je le fais a travers le timer et non a travers le fichier image ... apres avoir modifier le code vb ne plantait plus
je crois que cest trop te demander mais tu surais pas aussi commant faire avec la conversation (microphone) ?
cs_webooking
Messages postés17Date d'inscriptionlundi 18 juillet 2005StatutMembreDernière intervention18 juillet 2005 18 juil. 2005 à 13:54
Bonjour
Nous venons de créée un module webcam chat modifiable selon la demande, le webcam chat est en flash, et en module php dans quelque heures, également possibilité ifram.
Vous pouvez également gérer le flux vidéo et audio
pour info telechargement [mailto:admin@videolivenet.be admin@videolivenet.be]