473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

VB6 Save Cam Capture to file

104 100+
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
12 7309
Robbie
180 100+
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
Wernerh
104 100+
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
Wernerh
104 100+
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
180 100+
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
Wernerh
104 100+
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
180 100+
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
Wernerh
104 100+
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
180 100+
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
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
Wernerh
104 100+
Hi, have mailed you the source code
Apr 6 '09 #11
Wernerh
104 100+
gbayhan your mail address comes back with error
Apr 6 '09 #12
Wernerh, i got your mail... i dont know why you get an error mail.
Thank you for your help... :)
Apr 7 '09 #13

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

Similar topics

2
by: FlashMerlot | last post by:
We have an ASPX (C#) webform which hosts dropdownlists, textboxes, grids, checkboxes, etc. The users want to: #1 - "FREEZE" the entire webpage contents (and state) #2 - move IE browser to...
8
by: Colleyville Alan | last post by:
I have been working on an Access app that takes info from a file and writes it to a spreadsheet on a form, simultaneously saving the spreadsheet to Excel. I got the idea that the same concept...
1
by: Chris Ward | last post by:
Capture a client window and save as a file (bmp), WindowsXP platform. Does anyone know how to go about doing this with Managed C++ v7.1? Maybe GDI+? DirectX? IdeasVacuum
0
by: SWu | last post by:
Hi all Could someone please tell me how to receive and save the PDF that gets submitted from an FDF form? DETAILS ====== The server has PDF forms (i.e. FDFs) which the user can browse to and...
2
by: vbaDev | last post by:
Hi. I am using Access 2000 and in my code I'm exporting a table into an Excel file (creating it), then the code needs to export another query into the same file (a new worksheet). So I needed both a...
0
by: Joseph I. Ceasar | last post by:
In an earlier post, someone asked about how to save a page on the client programmatically. I also had to solve this problem and did use Steven's approach. It worked great! Now here is an...
0
by: Joseph I. Ceasar | last post by:
In an earlier post, someone asked about how to save a page on the client programmatically. I also had to solve this problem and did use Steven's approach. It worked great! Now here is an...
1
by: keyesarone | last post by:
Hi, I am using VC++ 6.0 with directshow 9.0 to capture video from the camera. Using GDI+ Bitmap class and i am saving the buffer image into JPEG format file. When i use GDI+, i can save the...
4
by: vipergt023 | last post by:
Hello, Does anyone know if there is a faster way to save BMPs in C#? Currently, I'm using this: MemoryStream ms = new MemoryStream(); picture.Save(ms,...
2
by: ekasII | last post by:
I'm trying to capture text input by user to file, password = wx.TextCtrl(self.panel_1,wx.ID_ANY,pos=(230,150),size=(200,20),style= wx.TE_PASSWORD) l__password_file = <path\file.txt>...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.