主頁 > 資料庫 > 如何保存pb中呼叫攝像頭后取得的影像?老是不成功(沒反應)?急

如何保存pb中呼叫攝像頭后取得的影像?老是不成功(沒反應)?急

2020-09-17 11:19:36 資料庫

我的代碼為
//cb_start
string lpszName
ulong ll
long l
ll=handle(parent)
lpszName='照片采集'
lhand= capCreateCaptureWindowA(lpszName,262144+12582912+1073741824+268435456,2,20,400,400,ll,0)
if lhand<> 0 then
Send(lhand, WM_CAP_SET_CALLBACK_VIDEOSTREAM,0,0);
Send(lhand, WM_CAP_SET_CALLBACK_ERROR, 0,0);
Send(lhand, WM_CAP_SET_CALLBACK_STATUSA, 0,0);
Send(lhand, WM_CAP_DRIVER_CONNECT, 0,0);
Send(lhand, WM_CAP_SET_SCALE,1,0);
Send(lhand, WM_CAP_SET_PREVIEWRATE, 66, 0);
Send(lhand, WM_CAP_SET_OVERLAY, 1, 0);
Send(lhand, WM_CAP_SET_PREVIEW, 1, 0);
end if
//cb_save
//lhand=
string s
s="e:\save.bmp"
if lhand<>0 then
Send(lhand,WM_CAP_SAVEDIB,0,s)
end if

uj5u.com熱心網友回復:

$PBExportHeader$uo_custom.sru
forward
global type uo_custom from userobject
end type
type cb_10 from commandbutton within uo_custom
end type
type cb_9 from commandbutton within uo_custom
end type
type cb_8 from commandbutton within uo_custom
end type
type cb_7 from commandbutton within uo_custom
end type
type cb_6 from commandbutton within uo_custom
end type
type cb_5 from commandbutton within uo_custom
end type
type cb_4 from commandbutton within uo_custom
end type
type cb_3 from commandbutton within uo_custom
end type
type cb_2 from uo_commandbutton within uo_custom
end type
type cb_1 from uo_commandbutton within uo_custom
end type
type st_1 from statictext within uo_custom
end type
type p_1 from picture within uo_custom
end type
type sle_addr from singlelineedit within uo_custom
end type
type sle_phone from singlelineedit within uo_custom
end type
type sle_id from singlelineedit within uo_custom
end type
type sle_name from singlelineedit within uo_custom
end type
type ddlb_type from dropdownlistbox within uo_custom
end type
type ddlb_sex from dropdownlistbox within uo_custom
end type
type st_12 from statictext within uo_custom
end type
type st_11 from statictext within uo_custom
end type
type st_10 from statictext within uo_custom
end type
type st_9 from statictext within uo_custom
end type
type st_8 from statictext within uo_custom
end type
type st_7 from statictext within uo_custom
end type
type gb_2 from groupbox within uo_custom
end type
end forward

global type uo_custom from userobject
integer width = 1970
integer height = 1360
long backcolor = 67108864
string text = "none"
long tabtextcolor = 33554432
long picturemaskcolor = 536870912
cb_10 cb_10
cb_9 cb_9
cb_8 cb_8
cb_7 cb_7
cb_6 cb_6
cb_5 cb_5
cb_4 cb_4
cb_3 cb_3
cb_2 cb_2
cb_1 cb_1
st_1 st_1
p_1 p_1
sle_addr sle_addr
sle_phone sle_phone
sle_id sle_id
sle_name sle_name
ddlb_type ddlb_type
ddlb_sex ddlb_sex
st_12 st_12
st_11 st_11
st_10 st_10
st_9 st_9
st_8 st_8
st_7 st_7
gb_2 gb_2
end type
global uo_custom uo_custom

type prototypes
function ulong capCreateCaptureWindowA(string lpszWindowName,ulong dwStyle,long li_x ,long li_y ,long nWidth ,long nHeight ,ulong ParentWin ,long  nId ) LIBRARY 'AVICAP32.DLL' 
end prototypes

type variables
Private:
  uint lhand
Constant long WM_USER=1024
Constant long WM_CAP_START = WM_USER 
Constant long WM_CAP_STOP = WM_CAP_START + 68 
Constant long WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10 
Constant long WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11 
Constant long WM_CAP_SAVEDIB = WM_CAP_START + 25 
Constant long WM_CAP_GRAB_FRAME = WM_CAP_START + 60 
Constant long WM_CAP_SEQUENCE = WM_CAP_START + 62 
Constant long WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START + 20 
Constant long WM_CAP_SEQUENCE_NOFILE =WM_CAP_START+  63 
Constant long WM_CAP_SET_OVERLAY =WM_CAP_START+  51 
Constant long WM_CAP_SET_PREVIEW =WM_CAP_START+  50 
Constant long WM_CAP_SET_CALLBACK_VIDEOSTREAM = WM_CAP_START +6 
Constant long WM_CAP_SET_CALLBACK_ERROR=WM_CAP_START +2 
Constant long WM_CAP_SET_CALLBACK_STATUSA= WM_CAP_START +3 
Constant long WM_CAP_SET_CALLBACK_FRAME= WM_CAP_START +5 
Constant long WM_CAP_SET_SCALE=WM_CAP_START+  53 
Constant long WM_CAP_SET_PREVIEWRATE=WM_CAP_START+  52 




uj5u.com熱心網友回復:




long wm_cap_savedatdib = 1049
long wm_cap_dlg_videoformat = 1065
long wm_cap_dlg_videosource = 1066
long wm_cap_dlg_videodisplay = 1067
long wm_cap_get_videoformat = 1068
long wm_cap_set_videoformat = 1069
long wm_cap_dlg_videocompression = 1070
long cf_bitmap = 2
long wm_close = 16
ulong scrcopy = 32
string gs_pic_path
string gs_cd_path
string gs_path
string gs_ds_pic
string gs_ds_cd
string gs_cd_rq
long gl_pic_sj = 0
end variables

forward prototypes
public subroutine of_clear ()
end prototypes

public subroutine of_clear ();sle_name.text  = ''
sle_id.text = ''
sle_phone.text = ''
sle_addr.text = ''
end subroutine
on uo_custom.create
this.cb_10=create cb_10
this.cb_9=create cb_9
this.cb_8=create cb_8
this.cb_7=create cb_7
this.cb_6=create cb_6
this.cb_5=create cb_5
this.cb_4=create cb_4
this.cb_3=create cb_3
this.cb_2=create cb_2
this.cb_1=create cb_1
this.st_1=create st_1
this.p_1=create p_1
this.sle_addr=create sle_addr
this.sle_phone=create sle_phone
this.sle_id=create sle_id
this.sle_name=create sle_name
this.ddlb_type=create ddlb_type
this.ddlb_sex=create ddlb_sex
this.st_12=create st_12
this.st_11=create st_11
this.st_10=create st_10
this.st_9=create st_9
this.st_8=create st_8
this.st_7=create st_7
this.gb_2=create gb_2
this.Control[]={this.cb_10,&
this.cb_9,&
this.cb_8,&
this.cb_7,&
this.cb_6,&
this.cb_5,&
this.cb_4,&
this.cb_3,&
this.cb_2,&
this.cb_1,&
this.st_1,&
this.p_1,&
this.sle_addr,&
this.sle_phone,&
this.sle_id,&
this.sle_name,&
this.ddlb_type,&
this.ddlb_sex,&
this.st_12,&
this.st_11,&
this.st_10,&
this.st_9,&
this.st_8,&
this.st_7,&
this.gb_2}
end on

on uo_custom.destroy
destroy(this.cb_10)
destroy(this.cb_9)
destroy(this.cb_8)
destroy(this.cb_7)
destroy(this.cb_6)
destroy(this.cb_5)
destroy(this.cb_4)
destroy(this.cb_3)
destroy(this.cb_2)
destroy(this.cb_1)
destroy(this.st_1)
destroy(this.p_1)
destroy(this.sle_addr)
destroy(this.sle_phone)
destroy(this.sle_id)
destroy(this.sle_name)
destroy(this.ddlb_type)
destroy(this.ddlb_sex)
destroy(this.st_12)
destroy(this.st_11)
destroy(this.st_10)
destroy(this.st_9)
destroy(this.st_8)
destroy(this.st_7)
destroy(this.gb_2)
end on

event destructor;if lhand <> 0 then 
send(lhand, WM_CAP_DRIVER_DISCONNECT, 0, 0)
lhand =0
end if
end event

event constructor;ddlb_sex.selectitem(1)
ddlb_type.selectitem(1)
end event

uj5u.com熱心網友回復:

type cb_10 from commandbutton within uo_custom
integer x = 1248
integer y = 1096
integer width = 343
integer height = 104
integer taborder = 140
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "保存"
end type

event clicked;blob lb_s
integer li_File
li_File = FileOpen("c:\save.bmp",StreamMode!, read!, LockWrite!)
FileRead ( li_File,lb_s)
updateblob xkz_jbzl set photo=:lb_s where zhao = '0404A40001';
messagebox('',sqlca.sqlerrtext)
commit;
Fileclose ( li_File)

end event

type cb_9 from commandbutton within uo_custom
integer x = 841
integer y = 1056
integer width = 343
integer height = 104
integer taborder = 130
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "資料庫"
end type

event clicked;// selectblob   tp   into   :lbb_dk_blob   from   ld_dktpb   where   dkbm   =:lm_s_dkbm;   
//  setpicture(p_3,lbb_dk_blob) 
blob lb_s
integer li_File
selectblob   photo   into   :lb_s   from   xkz_jbzl   where  zhao = '0404A40001';
setpicture(p_1,lb_s) 


end event

type cb_8 from commandbutton within uo_custom
integer x = 402
integer y = 1036
integer width = 343
integer height = 104
integer taborder = 120
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "檔案"
end type

event clicked;//string s_map
//s_map='c:\save.bmp'
//p_1.visible = true
//st_1.visible = false
//p_1.picturename = s_map
string   lm_add_hkbm   
  string     docname,     named       
  integer     value,li_f,i       
  integer     li_fileptr,li_loops       
  long     ll_filelen,ll_bytes_read       
  Blob     lbb_Read,lbb_Total       
  value     =     GetFileOpenName(     "選擇圖形檔案     ",   +     docname,     named,   "jpg     ",     +         "jpg     Files(*.jpg),*.jpg,"+"Bmp     Files     (*.BMP),*.BMP,"+"gif   files   (*.gif),*.gif")       
  IF     value     =     1     THEN           
  ll_filelen     =     FileLength(docname)             //獲取檔案長度,     必須在打開之前       
  li_fileptr     =     FileOpen(docname,STREAMMODE!,READ!,LOCKREAD!)                                                       
  If   li_fileptr     =     -1     Then       
  Beep(2)       
  MessageBox(     "錯誤",     "圖形檔案打開錯誤!     ")       
  Return       
  End     If       
   IF   ll_filelen   >   32765   THEN   
        li_loops   =   (   (ll_filelen   -   1)     /   32765   )   +   1   
  ELSE   
  li_loops   =   1   
  END   IF       
    
  For   i     =     1     to     li_loops           
    ll_bytes_read     =     FileRead(li_fileptr,lbb_Read)       
    lbb_Total     =     lbb_Total     +     lbb_Read       
  Next   
    updateblob xkz_jbzl set photo=:lbb_Total where zhao = '0404A40001';
messagebox('',sqlca.sqlerrtext)
commit;
  FileClose   (li_fileptr)   
    
  SetPicture(p_1,lbb_Total)       
end if
 

end event

uj5u.com熱心網友回復:

type cb_7 from commandbutton within uo_custom
integer x = 110
integer y = 856
integer width = 425
integer height = 104
integer taborder = 120
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "關閉攝像頭[&D]"
end type

event clicked;

if lhand <> 0 then
send(lhand,wm_cap_driver_disconnect,0,0)
send(lhand,wm_close,0,0)
lhand = 0
end if
end event

type cb_6 from commandbutton within uo_custom
integer x = 521
integer y = 864
integer width = 343
integer height = 104
integer taborder = 120
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "錄像[&L]"
end type

event clicked;string s
s = gs_cd_path + string(datetime(today(),now()),"yyyymmddhhmmss") + ".avi"

if lhand <> 0 then
send(lhand,wm_cap_file_set_capture_filea,0,s)
send(lhand,wm_cap_sequence,0,0)
end if

end event

type cb_5 from commandbutton within uo_custom
integer x = 1632
integer y = 888
integer width = 366
integer height = 104
integer taborder = 110
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "壓縮設定[&S]"
end type

event clicked;

if lhand > 0 then
send(lhand,wm_cap_dlg_videocompression,0,0)
end if

return
end event

type cb_4 from commandbutton within uo_custom
integer x = 891
integer y = 868
integer width = 343
integer height = 104
integer taborder = 100
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "格式設定"
end type

event clicked;

if lhand > 0 then
send(lhand,wm_cap_dlg_videoformat,0,0)
end if

return
end event

type cb_3 from commandbutton within uo_custom
integer x = 1253
integer y = 864
integer width = 343
integer height = 104
integer taborder = 90
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "源設定[&Y]"
end type

event clicked;

if lhand > 0 then
send(lhand,wm_cap_dlg_videosource,0,0)
end if

return
end event

uj5u.com熱心網友回復:

type cb_2 from uo_commandbutton within uo_custom
integer x = 1609
integer y = 716
integer width = 320
integer taborder = 80
boolean enabled = false
string text = "快照"
end type

event clicked;call super::clicked;//QiuHu-MLS   writed at 2005/08/24
string s_map
s_map='c:\save.bmp'
if FileExists(s_map) then FileDelete(s_map)
if lhand <> 0 then 
Send(lhand,WM_CAP_SAVEDIB,0,s_map);
p_1.visible = true
st_1.visible = false
p_1.picturename = s_map
send(lhand, WM_CAP_DRIVER_DISCONNECT, 0, 0)
lhand =0
this.enabled = false
cb_1.enabled = true
end if

end event

type cb_1 from uo_commandbutton within uo_custom
integer x = 1230
integer y = 716
integer width = 320
integer taborder = 70
string text = "攝像頭獲取"
end type

event clicked;call super::clicked;//QiuHu-MLS   writed at 2005/08/24
string lpszName,s
ulong l1
setpointer(hourglass!)
p_1.visible = false
st_1.visible = true
l1=handle(st_1)
lpszName='本地視頻'
//lhand=capCreateCaptureWindowA(lpszName,262144+12582912+1073741824 + 268435456,0,0,UnitsToPixels(st_1.width,XUnitsToPixels!),UnitsToPixels(st_1.height,YUnitsToPixels!),l1,0)
lhand=capCreateCaptureWindowA(lpszName,262144+12582912+1073741824 + 268435456 ,-5,-30,320,240,l1,0) 
if lhand <> 0 then   
  send(lhand, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0) 
  send(lhand, WM_CAP_SET_CALLBACK_ERROR, 0, 0) 
  send(lhand, WM_CAP_SET_CALLBACK_STATUSA, 0, 0) 
  send(lhand, WM_CAP_DRIVER_CONNECT, 0, 0) 
  send(lhand, WM_CAP_SET_SCALE, 1, 0) 
  send(lhand, WM_CAP_SET_PREVIEWRATE, 66, 0) 
  send(lhand, WM_CAP_SET_OVERLAY, 1, 0)
  send(lhand, WM_CAP_SET_PREVIEW, 1, 0) 
  cb_2.enabled = true
  
end if
setpointer(arrow!)



end event

type st_1 from statictext within uo_custom
integer x = 421
integer y = 84
integer width = 699
integer height = 616
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
boolean enabled = false
alignment alignment = center!
boolean border = true
boolean focusrectangle = false
end type

type p_1 from picture within uo_custom
integer x = 1230
integer y = 84
integer width = 699
integer height = 616
boolean enabled = false
boolean border = true
boolean focusrectangle = false
end type

type sle_addr from singlelineedit within uo_custom
integer x = 325
integer y = 700
integer width = 869
integer height = 104
integer taborder = 60
integer textsize = -9
integer limit = 50
end type

type sle_phone from singlelineedit within uo_custom
integer x = 325
integer y = 572
integer width = 869
integer height = 104
integer taborder = 50
integer textsize = -9
integer limit = 50
end type

type sle_id from singlelineedit within uo_custom
integer x = 325
integer y = 448
integer width = 869
integer height = 104
integer taborder = 40
integer textsize = -9
integer limit = 20
end type

type sle_name from singlelineedit within uo_custom
integer x = 325
integer y = 84
integer width = 869
integer height = 104
integer taborder = 10
integer textsize = -9
integer limit = 8
end type

type ddlb_type from dropdownlistbox within uo_custom
event ue_keydown pbm_keydown
integer x = 325
integer y = 332
integer width = 869
integer height = 376
integer taborder = 30
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
boolean sorted = false
boolean vscrollbar = true
string item[] = {"身份證","學生證","教師證","軍官證","老年證","駕駛證"}
borderstyle borderstyle = stylelowered!
end type

event selectionchanged;send(handle(this),256,9,0)
return 1
end event

type ddlb_sex from dropdownlistbox within uo_custom
integer x = 325
integer y = 212
integer width = 869
integer height = 376
integer taborder = 20
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
boolean sorted = false
string item[] = {"男","女"}
borderstyle borderstyle = stylelowered!
end type

event selectionchanged;send(handle(this),256,9,0)
return 1
end event

type st_12 from statictext within uo_custom
integer x = 59
integer y = 728
integer width = 283
integer height = 60
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "地        址:"
boolean focusrectangle = false
end type

type st_11 from statictext within uo_custom
integer x = 59
integer y = 604
integer width = 274
integer height = 60
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "電話號碼:"
boolean focusrectangle = false
end type

type st_10 from statictext within uo_custom
integer x = 59
integer y = 480
integer width = 274
integer height = 60
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "證件號碼:"
boolean focusrectangle = false
end type

type st_9 from statictext within uo_custom
integer x = 59
integer y = 356
integer width = 274
integer height = 60
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "證件型別:"
boolean focusrectangle = false
end type

type st_8 from statictext within uo_custom
integer x = 59
integer y = 240
integer width = 283
integer height = 60
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "性        別:"
boolean focusrectangle = false
end type

type st_7 from statictext within uo_custom
integer x = 59
integer y = 120
integer width = 283
integer height = 60
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "姓        名:"
boolean focusrectangle = false
end type

type gb_2 from groupbox within uo_custom
integer x = 14
integer width = 1947
integer height = 1008
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "會員資訊資料"
end type

uj5u.com熱心網友回復:

合并成uo_custom.sru匯入即可

uj5u.com熱心網友回復:

用 api 呼叫 攝像頭 原始碼 添加了保存代碼 用 api  呼叫 攝像頭 原始碼
//定義變數
uint lhand



//定義常數
long WM_USER=1024
long WM_CAP_START = WM_USER 
long WM_CAP_STOP = WM_CAP_START + 68 
long WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10 
long WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11 
long WM_CAP_SAVEDIB = WM_CAP_START + 25 
long WM_CAP_GRAB_FRAME = WM_CAP_START + 60 
long WM_CAP_SEQUENCE = WM_CAP_START + 62 
long WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START + 20 
long WM_CAP_SEQUENCE_NOFILE =WM_CAP_START+  63 
long WM_CAP_SET_OVERLAY =WM_CAP_START+  51 
long WM_CAP_SET_PREVIEW =WM_CAP_START+  50 
long WM_CAP_SET_CALLBACK_VIDEOSTREAM = WM_CAP_START +6 
long WM_CAP_SET_CALLBACK_ERROR=WM_CAP_START +2 
long WM_CAP_SET_CALLBACK_STATUSA= WM_CAP_START +3 
long WM_CAP_SET_CALLBACK_FRAME= WM_CAP_START +5 
long WM_CAP_SET_SCALE=WM_CAP_START+  53 
long WM_CAP_SET_PREVIEWRATE=WM_CAP_START+  52 



//定義api
function ulong capCreateCaptureWindowA(string lpszWindowName,ulong dwStyle,long x ,long y ,long nWidth ,long nHeight 

,ulong ParentWin ,long  nId ) LIBRARY 'AVICAP32.DLL' 



//初始化代碼
string lpszName
ulong l1
l1=handle(w_main)



lpszName='攝像頭界面...'
lhand=capCreateCaptureWindowA(lpszName,262144+12582912+1073741824 + 268435456 ,0,0,200,200,l1,0)
if lhand <> 0 then   
  send(lhand, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0) 
  send(lhand, WM_CAP_SET_CALLBACK_ERROR, 0, 0) 
  send(lhand, WM_CAP_SET_CALLBACK_STATUSA, 0, 0) 
  send(lhand, WM_CAP_DRIVER_CONNECT, 0, 0) 
  send(lhand, WM_CAP_SET_SCALE, 1, 0) 
  send(lhand, WM_CAP_SET_PREVIEWRATE, 66, 0) 
  send(lhand, WM_CAP_SET_OVERLAY, 1, 0)
  send(lhand, WM_CAP_SET_PREVIEW, 1, 0) 
end if



//保存到檔案
string s
s='c:\save.avi'
if lhand<>0 then
Send(lhand,WM_CAP_FILE_SET_CAPTURE_FILEA,0, s);
Send(lhand,WM_CAP_SEQUENCE, 0, 0)  //開始捕捉
end if



//停止保存
  send(lhand, WM_CAP_STOP, 0, 0) 



//保存為圖片
string s
s='c:\save.bmp'
if lhand <> 0 then 
Send(lhand,WM_CAP_SAVEDIB,0,s);
end if



//沒有攝像頭的可以去下載一個如下的軟體,可以虛擬攝像頭(此軟體可以放一個電影,代替正常攝像頭的攝像內容)
Vandate Virtual Camera 虛擬攝像頭 

uj5u.com熱心網友回復:

樓主的結貼率太低了,應當注意啊,呵呵

uj5u.com熱心網友回復:

樓上,我用你貼的代碼為何打開后是黑屏,保存后c:\save.bmp的大小為0.視頻是可以的

uj5u.com熱心網友回復:

頭昏中...........

uj5u.com熱心網友回復:

接貼率低 啊 

uj5u.com熱心網友回復:

頂。

uj5u.com熱心網友回復:

為什么不可以保存為JPG檔案啊,只能保存為BMP

uj5u.com熱心網友回復:

我在pb 10.5中實驗的結果是保存的影像名只取給定字串的第一個字母,且沒有后綴。這是怎么回事?

uj5u.com熱心網友回復:

newease的方法pb9 xp下沒有生成保存檔案

轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/65243.html

標籤:API 調用

上一篇:pb中如何使用LDAP

下一篇:用PB做一個危險品診斷資料庫,要應用于手機。。。。在線等

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • GPU虛擬機創建時間深度優化

    **?桔妹導讀:**GPU虛擬機實體創建速度慢是公有云面臨的普遍問題,由于通常情況下創建虛擬機屬于低頻操作而未引起業界的重視,實際生產中還是存在對GPU實體創建時間有苛刻要求的業務場景。本文將介紹滴滴云在解決該問題時的思路、方法、并展示最終的優化成果。 從公有云服務商那里購買過虛擬主機的資深用戶,一 ......

    uj5u.com 2020-09-10 06:09:13 more
  • 可編程網卡芯片在滴滴云網路的應用實踐

    **?桔妹導讀:**隨著云規模不斷擴大以及業務層面對延遲、帶寬的要求越來越高,采用DPDK 加速網路報文處理的方式在橫向縱向擴展都出現了局限性。可編程芯片成為業界熱點。本文主要講述了可編程網卡芯片在滴滴云網路中的應用實踐,遇到的問題、帶來的收益以及開源社區貢獻。 #1. 資料中心面臨的問題 隨著滴滴 ......

    uj5u.com 2020-09-10 06:10:21 more
  • 滴滴資料通道服務演進之路

    **?桔妹導讀:**滴滴資料通道引擎承載著全公司的資料同步,為下游實時和離線場景提供了必不可少的源資料。隨著任務量的不斷增加,資料通道的整體架構也隨之發生改變。本文介紹了滴滴資料通道的發展歷程,遇到的問題以及今后的規劃。 #1. 背景 資料,對于任何一家互聯網公司來說都是非常重要的資產,公司的大資料 ......

    uj5u.com 2020-09-10 06:11:05 more
  • 滴滴AI Labs斬獲國際機器翻譯大賽中譯英方向世界第三

    **桔妹導讀:**深耕人工智能領域,致力于探索AI讓出行更美好的滴滴AI Labs再次斬獲國際大獎,這次獲獎的專案是什么呢?一起來看看詳細報道吧! 近日,由國際計算語言學協會ACL(The Association for Computational Linguistics)舉辦的世界最具影響力的機器 ......

    uj5u.com 2020-09-10 06:11:29 more
  • MPP (Massively Parallel Processing)大規模并行處理

    1、什么是mpp? MPP (Massively Parallel Processing),即大規模并行處理,在資料庫非共享集群中,每個節點都有獨立的磁盤存盤系統和記憶體系統,業務資料根據資料庫模型和應用特點劃分到各個節點上,每臺資料節點通過專用網路或者商業通用網路互相連接,彼此協同計算,作為整體提供 ......

    uj5u.com 2020-09-10 06:11:41 more
  • 滴滴資料倉庫指標體系建設實踐

    **桔妹導讀:**指標體系是什么?如何使用OSM模型和AARRR模型搭建指標體系?如何統一流程、規范化、工具化管理指標體系?本文會對建設的方法論結合滴滴資料指標體系建設實踐進行解答分析。 #1. 什么是指標體系 ##1.1 指標體系定義 指標體系是將零散單點的具有相互聯系的指標,系統化的組織起來,通 ......

    uj5u.com 2020-09-10 06:12:52 more
  • 單表千萬行資料庫 LIKE 搜索優化手記

    我們經常在資料庫中使用 LIKE 運算子來完成對資料的模糊搜索,LIKE 運算子用于在 WHERE 子句中搜索列中的指定模式。 如果需要查找客戶表中所有姓氏是“張”的資料,可以使用下面的 SQL 陳述句: SELECT * FROM Customer WHERE Name LIKE '張%' 如果需要 ......

    uj5u.com 2020-09-10 06:13:25 more
  • 滴滴Ceph分布式存盤系統優化之鎖優化

    **桔妹導讀:**Ceph是國際知名的開源分布式存盤系統,在工業界和學術界都有著重要的影響。Ceph的架構和演算法設計發表在國際系統領域頂級會議OSDI、SOSP、SC等上。Ceph社區得到Red Hat、SUSE、Intel等大公司的大力支持。Ceph是國際云計算領域應用最廣泛的開源分布式存盤系統, ......

    uj5u.com 2020-09-10 06:14:51 more
  • es~通過ElasticsearchTemplate進行聚合~嵌套聚合

    之前寫過《es~通過ElasticsearchTemplate進行聚合操作》的文章,這一次主要寫一個嵌套的聚合,例如先對sex集合,再對desc聚合,最后再對age求和,共三層嵌套。 Aggregations的部分特性類似于SQL語言中的group by,avg,sum等函式,Aggregation ......

    uj5u.com 2020-09-10 06:14:59 more
  • 爬蟲日志監控 -- Elastc Stack(ELK)部署

    傻瓜式部署,只需替換IP與用戶 導讀: 現ELK四大組件分別為:Elasticsearch(核心)、logstash(處理)、filebeat(采集)、kibana(可視化) 下載均在https://www.elastic.co/cn/downloads/下tar包,各組件版本最好一致,配合fdm會 ......

    uj5u.com 2020-09-10 06:15:05 more
最新发布
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:33:24 more
  • MySQL中binlog備份腳本分享

    關于MySQL的二進制日志(binlog),我們都知道二進制日志(binlog)非常重要,尤其當你需要point to point災難恢復的時侯,所以我們要對其進行備份。關于二進制日志(binlog)的備份,可以基于flush logs方式先切換binlog,然后拷貝&壓縮到到遠程服務器或本地服務器 ......

    uj5u.com 2023-04-20 08:28:06 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:27:27 more
  • 快取與資料庫雙寫一致性幾種策略分析

    本文將對幾種快取與資料庫保證資料一致性的使用方式進行分析。為保證高并發性能,以下分析場景不考慮執行的原子性及加鎖等強一致性要求的場景,僅追求最終一致性。 ......

    uj5u.com 2023-04-20 08:26:48 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:26:35 more
  • 云時代,MySQL到ClickHouse資料同步產品對比推薦

    ClickHouse 在執行分析查詢時的速度優勢很好的彌補了MySQL的不足,但是對于很多開發者和DBA來說,如何將MySQL穩定、高效、簡單的同步到 ClickHouse 卻很困難。本文對比了 NineData、MaterializeMySQL(ClickHouse自帶)、Bifrost 三款產品... ......

    uj5u.com 2023-04-20 08:26:29 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:25:13 more
  • Redis 報”OutOfDirectMemoryError“(堆外記憶體溢位)

    Redis 報錯“OutOfDirectMemoryError(堆外記憶體溢位) ”問題如下: 一、報錯資訊: 使用 Redis 的業務介面 ,產生 OutOfDirectMemoryError(堆外記憶體溢位),如圖: 格式化后的報錯資訊: { "timestamp": "2023-04-17 22: ......

    uj5u.com 2023-04-20 08:24:54 more
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:24:03 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:23:11 more