为何选择capGetStatus& capDriverGetCaps不起作用? [英] Why capGetStatus & capDriverGetCaps doesn't work?

查看:88
本文介绍了为何选择capGetStatus& capDriverGetCaps不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经半成功地将我的旧VB6项目转换为VB.NET2003
http://wuhenry.beigetower.org/vbVideoInspection.rar ,这是一个简单的

网络摄像头程序,可以在VB6上完美运行。现在我在capGetStatus& capDriverGetCaps功能为
工作,所有的capGetStatus'& capDriverGetCaps''的最终结果

零!因此,我的一些IF语句不起作用。


capGetStatus获取捕获驱动程序的功能而

capDriverGetCaps获取捕获窗口属性..宽度和

高度。


任何人都在使用avicap32 .dll预览网络摄像头上的视频

或任何采集卡?如果我可以使用这两个

函数来工作真的很棒。我在互联网上搜索了样本,我看到了一些已经转换成.NET的b
,但他们从来没有使用过capGetStatus&

capDriverGetCaps。


上面的链接是我的VB.NET项目,AVICAP代码为EJ

Bantz Jr.,修改后可以在.NET框架上工作...... w / capGetStatus

& capDriverGetCaps无效。网络摄像头上的视频预览正在运行。


谢谢,

Henry

Hi, I''ve semi-successfully converted my old VB6 project to VB.NET2003
http://wuhenry.beigetower.org/vbVideoInspection.rar ,it is a simple
webcam program that works flawlessly on VB6. Now I''m having
difficulties with the capGetStatus & capDriverGetCaps function to
work, all of the capGetStatus''s & capDriverGetCaps'' properites ends up
zero! Thus leaving some of my IF statements non-working.

The capGetStatus "Gets the capabilities of the capture driver" while
the capDriverGetCaps "Gets the capture window attributes .. width and
height".

Anyone working on the avicap32.dll to preview videos on their webcam
or any capture card? It''ll really be great if I can get this two
functions to work. I''ve searched the internet for samples, I saw some
that are .NET converted, but they never did use the capGetStatus &
capDriverGetCaps.

The link above is my VB.NET project, with the AVICAP code of E. J.
Bantz Jr., modified to work on the .NET framework......w/ capGetStatus
& capDriverGetCaps NOT working. Video preview on webcam is working.

Thanks,
Henry

推荐答案

Henry Wu <他*********** @ hotmail.com> schrieb
"Henry Wu" <he***********@hotmail.com> schrieb
我已经半成功地将我的旧VB6项目转换为
VB.NET2003 http://wuhenry.beigetower.org/vbVideoInspection.rar

如果你把它作为Zip提供,也许你会得到一个答案文件,(我无法提取

rar')或未压缩的文件。

,它是一个简单的网络摄像头程序,可以完美地工作VB6。现在我对capGetStatus& capDriverGetCaps功能
工作,所有capGetStatus'& capDriverGetCaps''本身
结束为零!因此,我的一些IF语句不起作用。
Hi, I''ve semi-successfully converted my old VB6 project to
VB.NET2003 http://wuhenry.beigetower.org/vbVideoInspection.rar
Maybe you''ll get an answer if you provide it as Zip file, (I can''t extract
rar''s) or the uncompressed file.
,it is
a simple webcam program that works flawlessly on VB6. Now I''m
having difficulties with the capGetStatus & capDriverGetCaps function
to work, all of the capGetStatus''s & capDriverGetCaps'' properites
ends up zero! Thus leaving some of my IF statements non-working.




您是使用向导升级代码还是复制并粘贴源代码

代码?


您对两种功能的声明是什么?

-

Armin


如何报价以及原因:
http: //www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html



Did you upgrade the code using the wizard or did you copy&paste the source
code?

What''s your declaration of both functions?
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


我从vb6修改为vb.net。我已经在vb6完成了我已修改的满载

。我非常喜欢它

i从来没有问题。

函数capGetStatus(ByVal lwnd As Integer,ByVal s As Integer,ByVal

wSize As Short)作为布尔值

capGetStatus = SendMessage(lwnd,WM_CAP_GET_STATUS,wSize,s)

结束函数

函数capDriverGetCaps(ByVal lwnd As Integer,ByVal s作为整数,

ByVal wSize As Short)As Boolean

''capDriverGetCaps宏返回当前连接到的

捕获驱动程序的硬件功能一个捕获窗口。

capDriverGetCaps = SendMessage(lwnd,WM_CAP_DRIVER_GET_CAPS,wSize,s)

结束功能


以上是vfw i现在有错误问题。

现在我有5个错误问题到目前为止我会在以后做。我已经阅读了

你发布的帖子说你想要mnuvideofrm给孩子或者mdiparent。但是

u不能改变它,因为它是不变的。

Public Const WS_CHILD As Integer =& H40000000

if you removed它你会得到父母而不是孩子。

在你的情况下,你可以删除const到昏暗或私人,如果不是最好的方式

do是属性get / set procedure events 。

i我正在努力。但我必须先解决错误问题。

i可以帮助你。

问候


Henry Wu写道:
i modifed from vb6 to vb.net. i already done in vb6 with fully loaded
that i modified. i really loved it
i never had problem.
Function capGetStatus(ByVal lwnd As Integer, ByVal s As Integer, ByVal
wSize As Short) As Boolean
capGetStatus = SendMessage(lwnd, WM_CAP_GET_STATUS, wSize, s)
End Function
Function capDriverGetCaps(ByVal lwnd As Integer, ByVal s As Integer,
ByVal wSize As Short) As Boolean
''The capDriverGetCaps macro returns the hardware capabilities of the
capture driver currently connected to a capture window.
capDriverGetCaps = SendMessage(lwnd, WM_CAP_DRIVER_GET_CAPS, wSize, s)
End Function

above is vfw i had now error problem.
right now i have 5 error problems so far i will do it later. i have read
ur posted stating that u wanted mnuvideofrm to child or mdiparent. but
u can''t changed it becaue if that it is constant.
Public Const WS_CHILD As Integer = &H40000000
if u removed it u will get parent but not child.
in ur case u can remove const to dim or private and if not betst way to
do is property get/set procedure events.
i am working on. but i have to fixed errors problem first.
i can help u.
regards


Henry Wu wrote:
我已经半成功地将我的旧VB6项目转换为VB.NET2003
http://wuhenry.beigetower.org/vbVideoInspection.rar ,它是一个简单的网络摄像头程序,可以在VB6上完美运行。现在我在使用capGetStatus& ;;时遇到了困难。 capDriverGetCaps功能可以工作,所有的capGetStatus'& capDriverGetCaps''的最终结果为零!因此,我的一些IF语句不起作用。

capGetStatus获取捕获驱动程序的功能。而capDriverGetCaps获取捕获窗口属性..宽度和
高度。

任何使用avicap32.dll预览其网络摄像头视频的人
还是任何采集卡?如果我能让这两个功能发挥作用真的很棒。我在互联网上搜索样本,我看到一些已经转换成.NET的
,但他们从未使用过capGetStatus&
capDriverGetCaps。

上面的链接是我的VB.NET项目,AVICAP代码为EJ
Bantz Jr.,修改后可以在.NET框架上工作...... w / capGetStatus
& capDriverGetCaps无效。网络摄像头上的视频预览正在运行。

谢谢,
Henry
Hi, I''ve semi-successfully converted my old VB6 project to VB.NET2003
http://wuhenry.beigetower.org/vbVideoInspection.rar ,it is a simple
webcam program that works flawlessly on VB6. Now I''m having
difficulties with the capGetStatus & capDriverGetCaps function to
work, all of the capGetStatus''s & capDriverGetCaps'' properites ends up
zero! Thus leaving some of my IF statements non-working.

The capGetStatus "Gets the capabilities of the capture driver" while
the capDriverGetCaps "Gets the capture window attributes .. width and
height".

Anyone working on the avicap32.dll to preview videos on their webcam
or any capture card? It''ll really be great if I can get this two
functions to work. I''ve searched the internet for samples, I saw some
that are .NET converted, but they never did use the capGetStatus &
capDriverGetCaps.

The link above is my VB.NET project, with the AVICAP code of E. J.
Bantz Jr., modified to work on the .NET framework......w/ capGetStatus
& capDriverGetCaps NOT working. Video preview on webcam is working.

Thanks,
Henry






>如果你把它作为Zip文件提供,也许你会得到答案

你好这里是Zip文件链接:
http://wuhenry.beigetower.org/vbVideoInspection.zip
> Maybe you''ll get an answer if you provide it as Zip file
Hi here''s the Zip file link:
http://wuhenry.beigetower.org/vbVideoInspection.zip
你升级了吗?代码使用向导或您是否复制并粘贴源代码?
我没有使用.NET向导来升级我的代码,我从

scratch再次这样做了,因为我也想从头学习.NET :)

你对两种功能的声明是什么?
Did you upgrade the code using the wizard or did you copy&paste the source
code? I did not use the .NET wizard to upgrade my code, I did it again from
scratch since I wanted to learn .NET from scratch too :)
What''s your declaration of both functions?




capDriverGetCaps声明:

------------ ---------------------


公共职能capDriverGetCaps(ByVal lwnd As Integer,ByVal s As

整数,ByVal wSize为短)作为布尔值
capDriverGetCaps = SendMessage(lwnd,WM_CAP_DRIVER_GET_CAPS,

wSize,s)

结束函数

---------------------------------

capDriverGetCaps用法:

---------------------------------

capDriverGetCaps(lwndC,VarPtrAny(Caps),Len(Caps))

Debug.WriteLine(Caps.wDeviceIndex&" -wDeviceIndex")

Debug.WriteLine(Caps.fHasOverlay&" -fHasOverlay")

Debug.WriteLine(Caps.fHasDlgVideoSource&

" -fHasDlgVideo来源")

Debug.WriteLine(Caps.fHasDlgVideoFormat&

" -fHasDlgVideoFormat")

Debug.WriteLine(Caps.fHasDlgVideoDisplay& ;

" -fHasDlgVideoDisplay")

Debug.WriteLine(Caps.fCaptureInitialized&

" -fCaptureInitialized")

Debug.WriteLine(Caps.fDriverSuppliesPalettes&

" -fDriverSuppliesPalettes")

Debug.WriteLine(Caps.hVideoIn& " -hVideoIn")

Debug.WriteLine(Caps.hVideoOut&" -hVideoOut")

Debug.WriteLine(Caps.hVideoExtIn&" -hVideoExtIn" ;)

Debug.WriteLine(Caps.hVideoExtOut&" -hVideoExtOut")

Debug.WriteLine(CInt(False)&" -False")

Debug.WriteLine(CInt(True)&" -True")

------------------- --------------


使用VarPtrAny作为:

------------ ---------------------

公共函数VarPtrAny(ByVal o As Object)作为整数

Dim GC As System.Runtime.InteropServices.GCHandle =

System.Runtime.InteropServices.GCHandle.Alloc(o,

System.Runtime.InteropServices.GCHandleType.Pinned)

Dim ret As Integer = GC.AddrOfPinnedObject.ToInt32

GC.Free()

返回ret

结束函数

---------------------------------


capGetStatus声明

------------ ---------------------

公共函数capGetStatus(ByVal lwnd As Integer,ByVal s As

整数,ByVal wSize As Short)As Boolean

capGetStatus = SendMessage(lwnd,WM_CAP_GET_STATUS,wSize,s)

结束函数

---- -----------------------------


capGetStatus使用

---------------------------------

昏暗的CAPSTATUS作为CAPSTATUS

Dim ImageWidth As Integer

Dim ImageHeight As Integer


如果capGetStatus(lwnd,VarPtrAny(CAPSTATUS),Len(CAPSTATUS))那么

''//设置父表格的标题

ImageWidth = CAPSTATUS.uiImageWidth

ImageHeight = CAPSTATUS.uiImageHeight

SetWindowText(frmVideoPreviewGlobal.Handle.ToInt32," Video

Preview:" &安培; CAPSTATUS.uiImageWidth&英寸×" &安培; CAPSTATUS.uiImageHeight&

"分辨率)

结束如果

----------------------------- ----

capDriverGetCaps总是渲染0或False,即使我看到流媒体

视频预览。并且capGetStatus也不起作用,因为

CAPSTATUS.uiImageWidth& CAPSTATUS.uiImageHeight渲染视频

预览:0x0分辨率,但是,我有一个很干净的视频流

640x480或320x240或我设置的任何视频格式网络摄像头。


希望得到一些帮助,我真的被卡住了,有点难找到没有任何错误的

罪魁祸首出现:(


谢谢,

Henry



capDriverGetCaps declaration:
---------------------------------

Public Function capDriverGetCaps(ByVal lwnd As Integer, ByVal s As
Integer, ByVal wSize As Short) As Boolean
capDriverGetCaps = SendMessage(lwnd, WM_CAP_DRIVER_GET_CAPS,
wSize, s)
End Function
---------------------------------
capDriverGetCaps usage:
---------------------------------
capDriverGetCaps(lwndC, VarPtrAny(Caps), Len(Caps))

Debug.WriteLine(Caps.wDeviceIndex & "-wDeviceIndex")
Debug.WriteLine(Caps.fHasOverlay & "-fHasOverlay")
Debug.WriteLine(Caps.fHasDlgVideoSource &
"-fHasDlgVideoSource")
Debug.WriteLine(Caps.fHasDlgVideoFormat &
"-fHasDlgVideoFormat")
Debug.WriteLine(Caps.fHasDlgVideoDisplay &
"-fHasDlgVideoDisplay")
Debug.WriteLine(Caps.fCaptureInitialized &
"-fCaptureInitialized")
Debug.WriteLine(Caps.fDriverSuppliesPalettes &
"-fDriverSuppliesPalettes")
Debug.WriteLine(Caps.hVideoIn & "-hVideoIn")
Debug.WriteLine(Caps.hVideoOut & "-hVideoOut")
Debug.WriteLine(Caps.hVideoExtIn & "-hVideoExtIn")
Debug.WriteLine(Caps.hVideoExtOut & "-hVideoExtOut")
Debug.WriteLine(CInt(False) & "-False")
Debug.WriteLine(CInt(True) & "-True")
---------------------------------

Using VarPtrAny as:
---------------------------------
Public Function VarPtrAny(ByVal o As Object) As Integer
Dim GC As System.Runtime.InteropServices.GCHandle =
System.Runtime.InteropServices.GCHandle.Alloc(o,
System.Runtime.InteropServices.GCHandleType.Pinned )
Dim ret As Integer = GC.AddrOfPinnedObject.ToInt32
GC.Free()
Return ret
End Function
---------------------------------

capGetStatus declaration
---------------------------------
Public Function capGetStatus(ByVal lwnd As Integer, ByVal s As
Integer, ByVal wSize As Short) As Boolean
capGetStatus = SendMessage(lwnd, WM_CAP_GET_STATUS, wSize, s)
End Function
---------------------------------

capGetStatus usage
---------------------------------
Dim CAPSTATUS As CAPSTATUS
Dim ImageWidth As Integer
Dim ImageHeight As Integer

If capGetStatus(lwnd, VarPtrAny(CAPSTATUS), Len(CAPSTATUS)) Then
''//Set title of the parent form
ImageWidth = CAPSTATUS.uiImageWidth
ImageHeight = CAPSTATUS.uiImageHeight
SetWindowText(frmVideoPreviewGlobal.Handle.ToInt32 , "Video
Preview: " & CAPSTATUS.uiImageWidth & "x" & CAPSTATUS.uiImageHeight &
" Resolution")
End If
---------------------------------
capDriverGetCaps always renders 0 or False, even if I see a streaming
video preview. And also capGetStatus doesn''t work either because
CAPSTATUS.uiImageWidth & CAPSTATUS.uiImageHeight renders "Video
Preview: 0x0 Resolution", but again, I have a nice clean video stream
of 640x480 or 320x240 or whatever video format I set my webcam to.

Hoping for some help, I''m really stuck, it''s a bit hard to find the
culprit w/o any errors showing up :(

Thanks,
Henry


这篇关于为何选择capGetStatus&amp; capDriverGetCaps不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆