By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,326 Members | 2,726 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,326 IT Pros & Developers. It's quick & easy.

VB6 Save Cam Capture to file

100+
P: 104
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
Sep 7 '07 #1
Share this Question
Share on Google+
12 Replies


Robbie
100+
P: 180
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?

EDIT: 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? ><
Sep 7 '07 #2

100+
P: 104
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?
Sep 7 '07 #3

100+
P: 104
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?
It does not use the default cam software, it is completely standalone operational vb application. Can also create AVI etc.
Sep 7 '07 #4

Robbie
100+
P: 180
Well done with getting it to work. :)

It does not use the default cam software, it is completely standalone operational vb application. Can also create AVI etc.
That's what I was wondering how you did. I mean, what the code for initializing it is, and getting a current image from it.

I've been trying to do this, but I've only managed a measly 5 FPS or so, because it copies it to the clipboard, then loads that in a PictureBox, then you can save it.

So if you could show me what code you use, I would be very grateful! ^^;;
Sep 7 '07 #5

100+
P: 104
I would have to email you the sample application to do show you, can you send me your email address?
Sep 7 '07 #6

Robbie
100+
P: 180
I would have to email you the sample application to do show you, can you send me your email address?
Thanks! Well, you should be able to on my profile, but I just tested that, and it says that I've chosen not to share my email address, even though that's not true.

So you can use this link to upload it directly to my server if you like
(Link will only work for a few hours, for safety reasons ^-')

http://robbi-985.homeip.net:8000/tempupload.html
Sep 7 '07 #7

100+
P: 104
Thanks! Well, you should be able to on my profile, but I just tested that, and it says that I've chosen not to share my email address, even though that's not true.

So you can use this link to upload it directly to my server if you like
(Link will only work for a few hours, for safety reasons ^-')

http://robbi-985.homeip.net:8000/tempupload.html
Hi,

Did it for you and also a txt file called wernerh for you to read.

Cheers
Sep 8 '07 #8

Robbie
100+
P: 180
Hi,

Did it for you and also a txt file called wernerh for you to read.

Cheers
Thanks very much! =D
Now all I've gotta do is filter through all the code to find what I need, and try to understand it. --;
By the way, I'm using it to control a robotic arm using a camera. If I manage, I'll upload a video of it to YouTube or somewhere like that. ;)
Sep 8 '07 #9

P: 3
Hi,

I'm also interested in this thread. Can you also please send me the code?!
If you'd like to send, here is my email, gbayhan@bayhanmuhendislik.com

Thank you so much...
Apr 3 '09 #10

100+
P: 104
Hi, have mailed you the source code
Apr 6 '09 #11

100+
P: 104
gbayhan your mail address comes back with error
Apr 6 '09 #12

P: 3
Wernerh, i got your mail... i dont know why you get an error mail.
Thank you for your help... :)
Apr 7 '09 #13

Post your reply

Sign in to post your reply or Sign up for a free account.