Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving without using a common dialog

Status
Not open for further replies.

lmb3

Programmer
Jul 10, 2001
16
US
Hi,
I have a program that captures an image using a usb camera and allows the user to save that image as a jpeg file using a common dialog ShowSave method. I would like to instead, automatically save the jpeg file to a pre-set directory with a pre-set file name as soon as the user clicks the capture image button. Is there a way to get around the common dialog save?
Thanks!
 
If the image is already saved to disk, then you could do a file copy with this API.

Declare Function apiCopyFile Lib "kernel32" Alias "CopyFileA" _
(ByVal lpExistingFileName As String, _
ByVal lpNewFileName As String, _
ByVal bFailIfExists As Long) As Long

lpExistingFileName is the path/file name of the image,
lpNewFileName is the new path/file name of the image,
bFailIfExists: set it to false to overwrite the file name if it is aready there
 
Unfortunately, the jpeg image is not already saved anywhere. It has just been captured using a CapGrabFrame method that I didn't write. It is based on a WM_CAP_GRAB_FRAME command. Any more ideas???
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top