It is code for testing
The webcam screen can be bigger, but it will always go to the left top position
The idea is to use a webcam/camera with USB on top of the Robotarm.
In case of Dialog, I get a error : Error Twebcam, Load driver error, Check webcam connection.
In case of Window it is shown.
At this moment the webcam is the buildin one from the laptop.
I can send you the testing program but it is all cut and past parts from the forum, but working like first post. Once cleaned it could be a interesting sample for the sample dir.
It runs now also from the sample dir with
buildh.bat I just needed to add 1 lib : echo %hdirl%\googlefwh.lib + >> b32.bc
- Code: Select all Expand view RUN
#include "WebCam.ch"
Public oMain
// The Dialog/Window testing is done because I can't get all controls transparent on dialog or window
if cRun = "Dialog"
DEFINE DIALOG oMain SIZE 1400,900 PIXEL TRUEPIXEL ;
FONT oFont BRUSH oBrush ;
TITLE "Dialog Robotic Arm : " + FWVERSION
else
DEFINE WINDOW oMain FROM 50 , 100 TO 1000 , 1500 PIXEL TITLE "Window" BRUSH oBrush
endif
// Code for all kind of code that you see above
RunWebcam(oMain) // oMain can be the Dialog or Window like above
if cRun = "Dialog"
ACTIVATE DIALOG oMain CENTERED ;
ON INIT ( oWebView := TWebView():New(), oWebView:SetHtml( Html() ), oWebView:SetParent( oPanel ) ) ;
VALID ( oWebView:Terminate(), oWebView:Destroy(), .T. )
else
ACTIVATE WINDOW oMain ;
ON INIT ( oWebView := TWebView():New(), oWebView:SetHtml( Html() ), oWebView:SetParent( oPanel ) ) ;
VALID ( oWebView:Terminate(), oWebView:Destroy(), OTimer:Activate(), .T. )
endif
function runWebCam(oMain)
Local oWebCam
local hBmp
@ 12, 45 WEBCAM oWebCam SIZE 75, 120 OF oMain START ADJUST RATE 66
oWebCam:bLClicked = {|| MsgInfo( "Position can not be moved") }
Return Nil