Sccfc
asked on
image grab from webcam
Hi....I am quite new to VB6 and am playing about with code from a motion detection program.where this code plays a wav
file when motion is detected i would like to grab the image and store it when motion is detected.Any pointers on how i would go about this would be greatly appreciated.
Below is part of the code that i am using........thanks in advance.
Function OnMotion(M_Percent As Long)
If M_Percent > intruder.Slider1.Value Then
If (Count_Of_Motions_Flag = True) Then
Count_Of_Motions = Count_Of_Motions + 1
intruder.Text1 = Count_Of_Motions
Count_Of_Motions_Flag = False
sndPlaySound "alarm.wav", SND_ASYNC Or SND_NODEFAULT
End If
End If
If M_Percent <= intruder.Slider2.Value Then
Count_Of_Motions_Flag = True
End If
End Function
file when motion is detected i would like to grab the image and store it when motion is detected.Any pointers on how i would go about this would be greatly appreciated.
Below is part of the code that i am using........thanks in advance.
Function OnMotion(M_Percent As Long)
If M_Percent > intruder.Slider1.Value Then
If (Count_Of_Motions_Flag = True) Then
Count_Of_Motions = Count_Of_Motions + 1
intruder.Text1 = Count_Of_Motions
Count_Of_Motions_Flag = False
sndPlaySound "alarm.wav", SND_ASYNC Or SND_NODEFAULT
End If
End If
If M_Percent <= intruder.Slider2.Value Then
Count_Of_Motions_Flag = True
End If
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
p@ing
ASKER
thanks navstar16.......will have a look and maybe post a new question...........thanks again
ASKER
Function capGrabFrame(ByVal hCapWnd As Long) As Boolean
capGrabFrame = SendMessageAsLong(hCapWnd,
End Function
--------------------------
Function OnMotion(M_Percent As Long)
If M_Percent > Watchman.Slider1.Value Then
If (Count_Of_Motions_Flag = True) Then
Count_Of_Motions = Count_Of_Motions + 1
Watchman.Text1 = Count_Of_Motions
Count_Of_Motions_Flag = False
Call capGrabFrame(hCapWnd)
FileName = App.Path & "\pic.bmp"
retval = capFileSaveDIB(hCapWnd, FileName)
If (retval = False) Then
MsgBox "Problem saving frame", vbInformation, App.Title
End If
picCapture2.Picture = LoadPicture(FileName)
End If
If M_Percent <= Watchman.Slider2.Value Then
Count_Of_Motions_Flag = True
End If
End Function