Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there anyone tried Viscom VideoCap 3.0?
Message
 
To
26/05/2005 16:23:50
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01017840
Message ID:
01017938
Views:
21
>Would you do that for me(hope to have the full code)?
>
>How was the performance? Was it good?
>
>Regards,
>
>David,

It works very fast. I can't see any slowdown of my computer. About the quality of JPG I can't say anything because my webcam is infront of the light and when the Sun is shining :o)) whole picture is Black. Buut you can play with second parameter to see the difference. Here the full code from the example with ONLY one chenage from me. Instead of SnapShot() method I put SnapShotJPG():
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


**************************************************
*-- Form:         form1 (c:\program files\videocap activex control\examples\vfp\snapshot\form1.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   05/26/05 08:30:05 PM
*
DEFINE CLASS form1 AS form


	Height = 404
	Width = 570
	DoCreate = .T.
	AutoCenter = .T.
	Caption = "SnapShot"
	temp = 1
	Name = "form1"


	ADD OBJECT label1 AS label WITH ;
		Caption = "Video Format", ;
		Height = 25, ;
		Left = 5, ;
		Top = 294, ;
		Width = 85, ;
		Name = "Label1"


	ADD OBJECT cbovideoformat AS combobox WITH ;
		Height = 24, ;
		Left = 96, ;
		Style = 2, ;
		Top = 294, ;
		Width = 132, ;
		Name = "cbovideoformat"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 336, ;
		Left = 80, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Preview", ;
		Name = "Command1"


	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 336, ;
		Left = 200, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "SnapShot", ;
		Name = "Command2"


	ADD OBJECT image1 AS image WITH ;
		Height = 181, ;
		Left = 336, ;
		Top = 24, ;
		Width = 217, ;
		Name = "Image1"


	ADD OBJECT label11 AS label WITH ;
		Caption = "Video Input", ;
		Height = 17, ;
		Left = 5, ;
		Top = 266, ;
		Width = 75, ;
		Name = "Label11"


	ADD OBJECT cbovideoinput AS combobox WITH ;
		Height = 24, ;
		Left = 96, ;
		Style = 2, ;
		Top = 264, ;
		Width = 131, ;
		SelectedItemForeColor = RGB(0,0,0), ;
		Name = "cboVideoInput"


	ADD OBJECT label2 AS label WITH ;
		Caption = "Video Device", ;
		Height = 25, ;
		Left = 5, ;
		Top = 238, ;
		Width = 73, ;
		Name = "Label2"


	ADD OBJECT cbodevice AS combobox WITH ;
		Height = 25, ;
		Left = 96, ;
		Style = 2, ;
		Top = 234, ;
		Width = 193, ;
		Name = "cbodevice"


	ADD OBJECT videocap1 AS olecontrol WITH ;
		Top = 36, ;
		Left = 48, ;
		Height = 169, ;
		Width = 193, ;
		Name = "videocap1"


	PROCEDURE Load
	ENDPROC


	PROCEDURE Init
		*********** video source
		For Each mydevice In thisform.VideoCap1.Devices

		    thisform.cboDevice.AddItem (mydevice.Name)

		Next


		If thisform.cboDevice.ListCount > 0 
		    thisform.cboDevice.ListIndex = 1
		EndIf


		*************************************** video input

		For Each myvideoinput In thisform.VideoCap1.VideoInputs

		    thisform.cbovideoinput.AddItem (myvideoinput.Name)

		Next


		If thisform.cbovideoinput.ListCount > 0 
		    thisform.cbovideoinput.ListIndex = 1
		EndIf


		For Each myvideoformat In thisform.VideoCap1.VideoFormats

		  


		    thisform.cbovideoformat.AddItem (myvideoformat.Name)
		Next

		If thisform.cbovideoformat.ListCount > 0 
			thisform.cbovideoformat.ListIndex =1
		EndIf
	ENDPROC


	PROCEDURE QueryUnload
		clear events
	ENDPROC


	PROCEDURE cbovideoformat.Click
		thisform.command1.click()
	ENDPROC


	PROCEDURE command1.Click
		strDevice = thisform.cboDevice.List(thisform.cboDevice.ListIndex)
		deviceIndex = thisform.VideoCap1.Devices.FindDevice(strDevice)

		If deviceIndex <> -1 
		        thisform.VideoCap1.Device = deviceIndex
		EndIf

		strVideoFormat = thisform.cbovideoformat.List(thisform.cbovideoformat.ListIndex)
		videoFormatIndex = thisform.VideoCap1.VideoFormats.FindVideoFormat(strVideoFormat)

		If videoFormatIndex <> -1 
		        thisform.VideoCap1.VideoFormat = videoFormatIndex
		EndIf


		******************video input

		strVideoInput = thisform.cboVideoInput.List(thisform.cboVideoInput.ListIndex)
		VideoInputIndex = thisform.VideoCap1.VideoInputs.FindVideoInput(strVideoInput)

		If VideoInputIndex <> -1 
		        thisform.VideoCap1.VideoInput = VideoInputIndex
		EndIf
		**************


		thisform.VideoCap1.Start
	ENDPROC


	PROCEDURE command2.Click

		strFileName="C:\Test.Jpg"

		result = thisform.VideoCap1.SnapShotJPEG(strFileName,100)
		thisform.image1.picture=strFileName


		thisform.temp = thisform.temp + 1
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
BTW the package I downloaded comes with VFP examples. They are placed in
c:\program files\videocap activex control\examples\vfp\
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform