Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get bitmap of a WebCam capture, and display in dialog
#1
Hello Gintaras:


How to get the bitmap using Clipboard Functions and draw it on dialog.



Function fingerDtect
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
CAPDRIVERCAPS-- CaptureCaps
BITMAP-- mb
__MemBmp-- m_mb
if(hDlg) goto messages

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 515 317 "Dialog"
;3 Button 0x54032000 0x0 464 208 48 14 "Button"
;4 Static 0x5400000E 0x0 0 0 460 308 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030109 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_PAINT
,,PAINTSTRUCT p; int dc=BeginPaint(hDlg &p)
,,RECT r; GetClientRect hDlg &r;
,,;FillRect dc &r GetSysColorBrush(COLOR_BTNFACE)
,,BITMAP b; GetObjectW m_mb.bm sizeof(BITMAP) &mb
,,BitBlt dc 100 10 mb.bmWidth mb.bmHeight m_mb.dc 0 0 SRCCOPY
,,EndPaint hDlg &p
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,,int camscreen=GetDlgItem(hDlg,4)
,,int cwn=capCreateCaptureWindow(0,WS_CHILD|WS_VISIBLE,0,0,320,240,camscreen,0)
,,int hCaptureDevice=0
,,SendMessage cwn,WM_CAP_DRIVER_CONNECT,hCaptureDevice,0
,,;out CaptureCaps.fCaptureInitialized
,,SendMessage cwn,WM_CAP_DRIVER_GET_CAPS,sizeof(CAPDRIVERCAPS),&CaptureCaps
,,;out CaptureCaps.fCaptureInitialized
,,SendMessage cwn,WM_CAP_SET_SCALE,TRUE,0
,,SendMessage cwn,WM_CAP_SET_PREVIEWRATE,1,0
,,SendMessage cwn,WM_CAP_SET_PREVIEW,TRUE,0
,,SendMessage cwn,WM_CAP_GRAB_FRAME,0,0
,,wait 2
,,SendMessage cwn,WM_CAP_EDIT_COPY,0,0
,,OpenClipboard(hDlg)
,,;****HOW TO GET THIS BITMAP AND DRAW IT ON DIALOG USING GDI****
,,mb=&GetClipboardData(CF_BITMAP)
,,CloseClipboard
,,
,,
,,SendMessage cwn,WM_CAP_DRIVER_DISCONNECT,hCaptureDevice,0
,,RedrawWindow hDlg 0 0 RDW_INVALIDATE
,case IDOK
,case IDCANCEL
ret 1


Thank you
Regards


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)