Oh thats really cool indeed
Hmm but I still don#t get it working thoughPriewview seems to be activated
Code: Select all
Global hWndC
OpenWindow(0,0,0,640,480,#PB_Window_SystemMenu,"test")
;| #WS_VISIBLE
; initialize webcam
If OpenLibrary(0, "avicap32.dll")
*capAddress = IsFunction(0, "capCreateCaptureWindowA")
hWndC = CallFunctionFast(*capAddress, "test", #WS_CHILD , 695, 12, 40, 30, WindowID(), 1)
Debug hWndc
SendMessage_(hWndC, #WM_CAP_DRIVER_CONNECT, KameraID.l, 0) ; connect driver
SendMessage_(hWndC,#WM_CAP_SET_SCALE, #True, 0) ; no stretching
SendMessage_(hWndC, #WM_CAP_SET_PREVIEW, #True, 0) ;see its activated
SendMessage_(hWndC, #WM_CAP_SET_PREVIEWRATE, 50, 0) ; set preview-rate (milliseconds)
;SendMessage_(hWndC, #WM_CAP_END, 0, 0)
; Else
; MessageRequester("Scotty, we have a problem...","Sorry, but I cant find or open avicap32.dll...", #MB_ICONERROR)
; EndIf
;
; retrieve picture
Repeat
Event=WindowEvent()
If Event=#PB_Event_CloseWindow :End:EndIf
ClearClipboard()
SendMessage_(hWndC, #WM_CAP_EDIT_COPY, 0, 0)
img.l = GetClipboardData(#PB_ClipboardImage)
;SendMessage_(hWndC, #WM_CAP_END, 0, 0)
StartDrawing(WindowOutput())
DrawImage(img.l, 0, 0, 640, 480)
StopDrawing()
Delay(10)
ForEver
EndIf
PS; Sorry but things like that arent my best area^^