VB6将Cam Capture保存到文件中 [英] VB6 Save Cam Capture to file
问题描述
大家好。请允许任何人告诉我在这段代码中出错的地方。我连接了一个网络摄像头,通过此代码捕获图片。当我执行代码时,它不会将其保存到我设置的文件和文件夹路径中。它提供了c:\ my Documents Save对话框。
(代码)
私有子mnuSaveFrame_Click()
Dim FileName As String
Dim retVal As Boolean
filter:=" DIB位图文件(* .bmp)| * .bmp",_
DlgTitle:="保存图片",_
DefaultExt:=" bmp",_
所有者:= Me.hWnd)
如果错误<> retVal然后
retVal = capFileSaveDIB(hCapWnd,FileName)
如果为True<> retVal然后
MsgBox问题保存框架,vbInformation,App.Title
结束如果
结束如果
结束子
谢谢
Hi everyone. Please could anyone tell me where I am going wrong in this code. I have a webcam connected that captures the a pic through this code. When I execute the code it does not save it to the file and folder path I have set. It comes up with the c:\my Documents Save dialog box.
(Code)
Private Sub mnuSaveFrame_Click()
Dim FileName As String
Dim retVal As Boolean
retVal = VBGetSaveFileName(FileName = "c:\Program files\Sg\Pic Men\Men1.bmp", _
filter:="DIB Bitmap Files (*.bmp)|*.bmp", _
DlgTitle:="Save Picture", _
DefaultExt:="bmp", _
Owner:=Me.hWnd)
If False <> retVal Then
retVal = capFileSaveDIB(hCapWnd, FileName)
If True <> retVal Then
MsgBox "Problem saving frame", vbInformation, App.Title
End If
End If
End Sub
Thanks
推荐答案
我不知道这是否适用于VB6 (还没有像以前那样使用过保存对话框),但 VBGetSaveFilename 中不应该获取 设置吗?
编辑:你是说'你通过VB控制一个凸轮?如果是这样,你能告诉我你是如何做到的吗? ><
I don''t know if that''s for VB6 (haven''t used a save dialog like that before), but shouldn''t the Get be Set in VBGetSaveFilename?
Are you saying that'' you''re controlling a cam through VB? If so, could you please let me know how you''re managing to do so? ><
我已经能够解决它了。我的新代码是这样的:
(代码)VB
私有子mnuSaveFrame_Click()
Dim FileName As String
Dim retVal As Boolean
filter:=" DIB Bitmap Files(* .bmp)| * .bmp",_
DlgTitle:=" Save Picture",_
InitDir:=" c:\program files\sg\pic men" ;,_
DefaultExt:=" bmp",_
所有者:= Me.hWnd)
如果错误< ;> retVal然后
retVal = capFileSaveDIB(hCapWnd,FileName)
如果为True<> retVal然后
MsgBox问题保存框架,vbInformation,App.Title
结束如果
结束如果
End Sub
我有vb初始化凸轮然后使用此脚本将图像保存到目录。这是你的问题吗?
I have been able to sort it out. My new code is this :
(code)VB
Private Sub mnuSaveFrame_Click()
Dim FileName As String
Dim retVal As Boolean
retVal = VBGetSaveFileName(FileName, _
filter:="DIB Bitmap Files (*.bmp)|*.bmp", _
DlgTitle:="Save Picture", _
InitDir:="c:\program files\sg\pic men", _
DefaultExt:="bmp", _
Owner:=Me.hWnd)
If False <> retVal Then
retVal = capFileSaveDIB(hCapWnd, FileName)
If True <> retVal Then
MsgBox "Problem saving frame", vbInformation, App.Title
End If
End If
End Sub
I have vb Initialise the cam and then use this script to save the image to a dir. Was that your question?
我已经能够解决它了。我的新代码是这样的:
(代码)VB
私有子mnuSaveFrame_Click()
Dim FileName As String
Dim retVal As Boolean
filter:=" DIB Bitmap Files(* .bmp)| * .bmp",_
DlgTitle:=" Save Picture",_
InitDir:=" c:\program files\sg\pic men" ;,_
DefaultExt:=" bmp",_
所有者:= Me.hWnd)
如果错误< ;> retVal然后
retVal = capFileSaveDIB(hCapWnd,FileName)
如果为True<> retVal然后
MsgBox问题保存框架,vbInformation,App.Title
结束如果
结束如果
End Sub
我有vb初始化凸轮然后使用此脚本将图像保存到目录。那是你的问题吗?
I have been able to sort it out. My new code is this :
(code)VB
Private Sub mnuSaveFrame_Click()
Dim FileName As String
Dim retVal As Boolean
retVal = VBGetSaveFileName(FileName, _
filter:="DIB Bitmap Files (*.bmp)|*.bmp", _
DlgTitle:="Save Picture", _
InitDir:="c:\program files\sg\pic men", _
DefaultExt:="bmp", _
Owner:=Me.hWnd)
If False <> retVal Then
retVal = capFileSaveDIB(hCapWnd, FileName)
If True <> retVal Then
MsgBox "Problem saving frame", vbInformation, App.Title
End If
End If
End Sub
I have vb Initialise the cam and then use this script to save the image to a dir. Was that your question?
它不使用默认的cam软件,它是完全独立的运行vb应用程序。也可以创建AVI等。
It does not use the default cam software, it is completely standalone operational vb application. Can also create AVI etc.
这篇关于VB6将Cam Capture保存到文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!