Click here to Skip to main content
15,905,323 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In C# WinForm how to save a captured image from a webcam?..i have a code below..
C#
string strGrabFileName = String.Format("C:\\Snapshot.jpg", DateTime.Now);
bitmap.Save(strGrabFileName, System.Drawing.Imaging.ImageFormat.Jpeg);

when i click on the capture button it shows an error on the last line..anyone help me to solve it..
Posted
Comments
Member 10434230 18-Dec-13 2:30am    
can you post the error and code where you are initializing bitmap
ManUtdRockz 18-Dec-13 4:36am    
Error message
External exception was unhandled
A generic error occurred in GDI+
agent_kruger 18-Dec-13 5:14am    
idont think so bitmap.Save(strGrabFileName, System.Drawing.Imaging.ImageFormat.Jpeg); will get you webcam image.

1 solution

make sure you have access to write in c drive. change the path to some other drive and check.
 
Share this answer
 
Comments
ManUtdRockz 18-Dec-13 6:40am    
I changed the location, now it working...thank you.. and one more question, now its take only one image, i want to take more captured images what should i code...!

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