WebCam control

WebCam control

Postby codemaker » Tue Oct 29, 2013 7:13 pm

I am trying to control a webcam from my app.
Started with testing the WEBCAM.PRG from FWH1304

When I try to compile it in xHArbour, I got this errors:
Code: Select all  Expand view

Creating object: webcam.EXP
Creating library: [b]webcam.LIB[/b]
xLINK: error: Unresolved external symbol '_capCreateCaptureWindowA referenced from FiveHCM.lib(WEBCAM.obj)'.
xLINK: error: Unresolved external symbol '_capGetDriverDescriptionA referenced from FiveHCM.lib(WEBCAM.obj)'.
xLINK: fatal error: 2 unresolved external(s).
 

How can I overcome this?
I am not creating a LIB as the error states above.
Maybe some LIB is missing here?

I also tried to use the WEBCAM2.RAR file Antonio posted somewhere (cannot remember where now) and it is for Harbour so I need a version for xHarbour and FWH1304

My app needs to be in xHarbour (don't ask me for the reason, I know Antonio will jump first :) )
Is there some code someone wants to share:
I actually need this:
- when the user clicks the button, the camera takes a picture of what it see and saves the image on disk.

Thanks
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: WebCam control

Postby codemaker » Tue Oct 29, 2013 8:03 pm

Right now I am testing another PRG which I found also here somebody posted.
WEBCAM32.PRG:

Code: Select all  Expand view

Function Test()
  Local oWnd, oMenu, oImg
  Local oWC

  DllWebCam:=LoadLibrary("avicap32.dll")        //LoadLib32("avicap32.dll")
  if Abs( DllWebCam ) > 32
        //? "Loaded ok"
  ELSE
        MsgAlert( "Error code: " + LTrim( Str( DllWebCam ) ) + " loading AVICAP32.DLL" )
  endIF

  oWC:=tWebCamPhoto():New()

  DEFINE WINDOW oWnd FROM 0,0 TO 5,5
  ACTIVATE WINDOW oWnd ON INIT ( oWC:CreateWnd(oWnd,60,10,320,240),;
        oWC:Connect(),;
    oWC:Save(oImg, STRZERO(SECONDS(),6,0)+'.bmp'),;
       oWC:Disconnect(),;
       oWC:End(),;
       oWnd:End() ) ICONIZED
RETURN(NIL)
 

Using xHarbour January 2013 + FWH1304

The main thing is to take a picture of the user after he/she press some button. But, no visible action shown, except the webcam light briefly flash when taking a picture. Probably this light can be also hidden, I don't know how for now

Every time I run this EXE, it takes a picture on webcam and save it on disk as SECONDS().BMP
Basically this will do the job for me, but there is probably more elegant solution.

I would appreciate any suggestion
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: WebCam control

Postby Antonio Linares » Wed Oct 30, 2013 12:48 pm

Boris,

For your first post please try to link avicap32.lib from your used C compiler
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: WebCam control

Postby Antonio Linares » Wed Oct 30, 2013 12:53 pm

Boris,

Have you reviewed this working example (with source code included) from Javier Lloris ?

https://code.google.com/p/fivewin-contributions/downloads/detail?name=webcam.rar
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: WebCam control

Postby codemaker » Wed Oct 30, 2013 2:49 pm

Antonio,
why should I link avicap32.lib?
The saving to BMP works.
Saving to JPG doesn't work, have no idea why - maybe this is why I need avicap32.lib?

Will try the sample you suggested
Thanks
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: WebCam control

Postby Antonio Linares » Wed Oct 30, 2013 3:01 pm

Boris,

In your first post you mention two unresolved externals.

Those unresolved externals are provided in avicap32.lib
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: WebCam control

Postby codemaker » Wed Oct 30, 2013 10:12 pm

Ok, thanks Antonio
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 94 guests