Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get bitmap of a WebCam capture, and display in dialog
#2
Function dlg_display_clipboard_bitmap
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("dlg_display_clipboard_bitmap" &dlg_display_clipboard_bitmap 0)) ret

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

ret
;messages
__MemBmp-- t_mb
sel message
,case WM_INITDIALOG
,
,case WM_PAINT
,PAINTSTRUCT p; int dc=BeginPaint(hDlg &p)
,BITMAP b; GetObject t_mb.bm sizeof(BITMAP) &b
,BitBlt dc 10 10 b.bmWidth b.bmHeight t_mb.dc 0 0 SRCCOPY
,EndPaint hDlg &p
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,OpenClipboard(hDlg)
,int h=GetClipboardData(CF_BITMAP)
,if(h) t_mb.Attach(CopyImage(h IMAGE_BITMAP 0 0 0))
,CloseClipboard
,InvalidateRect hDlg 0 1
,
,case IDOK
,case IDCANCEL
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)