Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Snapshot using camera of laptop

Status
Not open for further replies.

eyeshield21

Programmer
Aug 13, 2014
62
PH
i have found code to take a picture but the problem is
i always run it 3-10 times to make it work..

i already loop it but it lags a lot..


what i want is the system gets snapshot after the user
prompts to log in.
 
i always run it 3-10 times to make it work..

You haven't told us WHY you NEED to run it 3-10 times.

What happens each time you run it?
Do you get an error message?
Or what?

Have you used the VFP Debugging tools to see what is occurring?

Good Luck,
JRB-Bldr

 
If you don't know how to use VFP debugging tools, let us know...
Easier to guide you when you discover how to resolve some of these problems by watching your code run, but some new to VFP aren't aware of their existence or how to use them.


Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
If you happen to not be familiar with the VFP Debugging tools, you might want to look at the following.

On the web page: Link
There is one tutorial video named:
Building a Simple Application - Pt. 2
Part 2 of the series. In this video we complete the User (staff) management forms. One highlight of this video is the use of the Visual FoxPro Debugger.

Good Luck,
JRB-Bldr

 
Don't give us links to other links that might eventually allow us to see your problem.
In fact this time it did not work at all when I tried to follow the links.

Instead, WRITE the TEXT of the error message into your Reply posting so that we can read it without having to jump all around.

Good Luck,
JRB-Bldr
 
actually there is no error message displayed that is why i uploaded the image.
it is just a pop up screen showing to select the driver of camera. while the form with the camera control
displays a black screen.
 
eyeshield,
Do you have problems with the camera otherwise? (I mean, does it function fine with other applications?)
If it does, it's not a driver issue. So get past that. Unless you are using something like a 3rd part TWAIN capture, outside the devices normal driver, then it could be your API.


Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
This is getting nowhere.

Please show the code that produces the current result. Then we'll know what you're doing and may perhaps spot what's causing whatever result you're getting.

Otherwise, everyone is guessing in the dark. It's a waste of everyone's time, including yours.
 
We don't want to see ALL of your code.
How can we understand what specifically and/or where specifically things are going wrong?

Just show us the code that is causing the problem.

If you don't know which part of the code that might be, then I'd suggest that you learn to use the VFP Debugging tools that we have referenced above and focus in on just that part of the code that is failing.

THEN show us that part of the code ONLY.

Good Luck,
JRB-Bldr
 
Don't be too hard on the guy...
He's clearly struggling, and very new. One user says "post the code" now another says "too much code".
Some problems aren't so clear either. From what I see of his issue, there is no "error" it just that he has to make 3 - 5 tries to get there.
We're a community of self-support... with a wide range of skill sets. Not everyone understands everything that "we" know or what we think should be intuitive.

eyeshield, have you tried this on another machine and/or with another camera?
Also, do you have access to the person who wrote the routie originally?


Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
tnx guys..
i believe this part.
Code:
PROCEDURE DriverConnect
	THIS.msg(WM_CAP_DRIVER_CONNECTS,0,0) 


    IF THIS.IsCaptureConnected()
	ThisForm.StartPreview		
	THIS.GetCaptureDimensions
	STORE .T. TO THIS.cmdGetFrame.Enabled;

		THIS.Caption = THIS.Caption + ": connected, " +;
			LTRIM(STR(THIS.capWidth)) + "x" +;
			LTRIM(STR(THIS.capHeight))
			
			#DEFINE WM_CAP_FILE_SAVEDIB (WM_CAP_START + 25)

				LOCAL lcFile
				lcFile = "c:\System\Pictures_Here\1.jpg"
				THIS.msg(WM_CAP_GRAB_FRAME, 0,0)
				THIS.msg(WM_CAP_FILE_SAVEDIB, 0, lcFile,1)


	ELSE	
	
		THIS.CAPTION = THIS.CAPTION + ": FAILED TO CONNECT. PLEASE TRY AGAIN LATER."
	ENDIF

The title bar shows the "failed to connect.please try again later."
and that means the
Code:
THIS.msg(WM_CAP_DRIVER_CONNECTS,0,0)
was false..
but when i tried to run it again and again, it works.
 
ill try sir scott..
sorry but i dont..i just copied this to the internet..
 
I saw on another forum that is a problem with the code and MOST of built in webcams , try using an USB camera and the problem will go away, I also have the same problem when using the built in webcam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top