在pb中调用摄像关怎么没反应呀?急
这是我的代码,看不出来错误,但执行时摄像头没反应,跟踪看了窗口句柄ul_llt和返回值变量都非空,请高手看看指点,急!
//global var:
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
//global external function
public function ulong capCreateCaptureWindowA(string lpszWindowName,ulong dwStyle,long x,long y,long nWidth,long nHeight,ulong ParentWin,long nId) library "AVICAP32.DLL";
//w_video中的cb_start
string lpszName
ulong ul_ll
ul_ll=handle(w_video)
lpszName='照片采集'
lhand= capCreateCaptureWindowA(lpszName,262144+12582912+1073741824+268435456,0,0,200,200,ul_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
//global var:
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
//global external function
public function ulong capCreateCaptureWindowA(string lpszWindowName,ulong dwStyle,long x,long y,long nWidth,long nHeight,ulong ParentWin,long nId) library "AVICAP32.DLL";
//w_video中的cb_start
string lpszName
ulong ul_ll
ul_ll=handle(w_video)
lpszName='照片采集'
lhand= capCreateCaptureWindowA(lpszName,262144+12582912+1073741824+268435456,0,0,200,200,ul_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
...全文
相关推荐
MT9P031.pdf
500万-MT9P031_5100_PB 资料
PowerBuilder调用高拍仪实战:从摄像头预览到二维码识别
摄像头图像采集与二维码识别是桌面应用集成中的常见场景。在金融、政务等存量业务系统中,大量基于PowerBuilder(PB)开发的客户端仍需兼容高拍仪、证件扫描仪等外设,而PB生态相对封闭,开发者常面临无官方库、文档缺失等困境。本文从技术选型出发,对比厂商SDK、avicap32原生接口和本地中间服务三条路径,剖析视频预览、单帧抓取、BMP转JPG、二维码识别等核心环节,并给出数据窗口回显、设备稳定性等实战坑点。无论你是维护老系统,还是新开发PB项目,都能从这套链路中找到可落地的集成方案。文章重点介绍了Po
10.开脑洞Al还可以帮我们做什么?.pdf
10.开脑洞Al还可以帮我们做什么?.pdf
企业架构中实施大数据解决方案
企业架构中实施大数据解决方案
基于大数据技术的视频监控应用研究与探索.docx
基于大数据技术的视频监控应用研究与探索.docx


API 调用
