Click here to Skip to main content
15,889,403 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to save the captured image to a particular path.i am doing number plate detection project,i want to store captured image to get save in particular folder.
Posted
Comments
george4986 23-Sep-14 1:11am    
try this link
http://msdn.microsoft.com/en-us/library/9t4syfhh(v=vs.110).aspx

1 solution

Try this code


C#
if (!System.IO.File.Exists(savePath))
    {
       pic.SaveAs(savePath);                   
    }


Set your image folder path in 'savePath' variable
'pic' contain the picture data
 
Share this answer
 
Comments
Sinisa Hajnal 23-Sep-14 2:30am    
Except ditch the check if file exists or you'll never get new files...either overwrite the existing or add else and change the name of each new file if the one exists.
Shemeemsha (ഷെമീംഷ) 23-Sep-14 3:23am    
Yes..For that he can use GUID
Just add one line of code
var filename = Guid.NewGuid().ToString("N");

It will generate a random filename like
a1fce97afa8343eead6b94c57986950f

Then add he file extension and save the file :) :) (Y)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900