http://sol.gfxile.net/code.html
download the escapi21.zip and pull out the escapi.dll
Code: Select all
#define PTC_WIN
#include "tinyptc.bi"
Dim escapi_dll As any ptr
Type SimpleCapParams
mTargetBuf As Integer Ptr
mWidth As Integer
mHeight As Integer
End Type
Dim Shared initCOM As Function stdcall () As Integer
Dim Shared countCaptureDevices As Function stdcall () As Integer
Dim Shared initCapture As Function stdcall (deviceno As Uinteger, aParams As SimpleCapParams Ptr) As Integer
Dim Shared deinitCapture As Function stdcall (deviceno As Uinteger) As Integer
Dim Shared doCapture As Function stdcall (deviceno As Uinteger) As Integer
Dim Shared isCaptureDone As Function stdcall (deviceno As Uinteger) As Integer
Dim Shared getCaptureDeviceName As Sub stdcall (deviceno As Uinteger, namebuffer As Zstring Ptr, bufferlength As Integer)
Dim Shared ESCAPIDLLVersion As Function stdcall () As Integer
escapi_dll = DYLIBLOAD("escapi")
initCOM = DYLIBSYMBOL(escapi_dll, "initCOM")
countCaptureDevices = DYLIBSYMBOL(escapi_dll, "countCaptureDevices")
initCapture = DYLIBSYMBOL(escapi_dll, "initCapture")
deinitCapture = DYLIBSYMBOL(escapi_dll, "deinitCapture")
doCapture = DYLIBSYMBOL(escapi_dll, "doCapture")
isCaptureDone = DYLIBSYMBOL(escapi_dll, "isCaptureDone")
getCaptureDeviceName = DYLIBSYMBOL(escapi_dll, "getCaptureDeviceName")
ESCAPIDLLVersion = DYLIBSYMBOL(escapi_dll, "ESCAPIDLLVersion")
initCOM()
dim camname as zstring*100
dim l1 as integer
dim capparams as SimpleCapParams
dim buffer(320,240) as integer
capparams.mTargetBuf=@buffer(0,0)
capparams.mWidth=320
capparams.mHeight=240
print initCapture(0, @capparams)
print doCapture(0)
while isCaptureDone(0) <> 1
sleep(10)
wend
print "Captured"
ptc_open("WebCam", 320, 240)
while inkey$=""
ptc_update(@buffer(0,0))
doCapture(0)
while isCaptureDone(0) <> 1
sleep(10)
wend
wend
ptc_close()
deInitCapture(0)
sleep