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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

capture Image from webCam to form in vfp9

Status
Not open for further replies.

jhed

Programmer
Apr 21, 2014
33
PH
sir... can anyone help me to make this possible, i have this form to capture persons face to add his profile..i searched from the internet and found useful infos but unfortunately didn't fit my needs.. the code on displaying the form to get frame on the image was there but i want to take the image directly to may form when i click get frame... can anyone who has an idea for this one?


thanx in advance
 
Hi Jhed, welcome to the forum.

Yuor question is not completely clear. What do you mean by getting the image on the form by clicking the frame? What frame?

It would help if you could tell us what you have done so far. What tools are using to capture the image?

You might also find this article useful: Controlling TWAIN devices from within Visual FoxPro. It will tell you how to capture an image from a TWAIN-compliant webcam. Once you have the image in memory, you can display it on a form, save it to a file, and other things.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
sorry sir for that... i said that because all of the suggestion that i found on the internet have that get frame button to get the image frame... i also used that eztwain that you have suggested..the program is there but i want to add that feature when clicking the get frame, the image that was capture will be automatically loaded in the form.. is it possible sir??

thank you..
 
If you mean that you want to display the "viewfinder" in a VFP form, then the answer is no. At least, not with the EZTwain control. (By "viewfinder", I mean a control in which you can see what the webcam is seeing, continuously and in real time.)

But if you want to display the image after you have captured it, that's easy. Just save it to a file (a BMP, for example). The code in the article shows you how to do that. Then set the Picture property of an Image control to point to that same file.

A very simplified example:

Code:
lnImageHandle = TWAIN_AcquireNative(0,0)
lnReply = TWAIN_WriteNativeToFilename(lnImageHandle,"c:\images\test.bmp")
IF lnReply = 0
  * Image successfully saved
  THISFORM.Image1.Picture = "c:\images\test.bmp"
ENDIF
TWAIN_FreeNative(lnImageHandle)

This assumes that you have an image control, named Image1, on your form.

Does that answer your question?

Mike




__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Most 'newer' models of webcams and digital cameras will not support "Twain" drivers.
You have to find alternatives.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
really, TWAIN image capture can't help in this situation, a friend introduce this to me, i haven't tried yet. then what capturing technology should we use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top