Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys

Is there a way to streamwrite an image to a file?

Share this answer
Anele Ngqandu 24-Jan-12 3:56am    
Hi Sir...I dont want to write text to a file but I want to have an image in my file.
Use the BinaryWriter class instead.

And, why do you want to use StreamWriter?

You can just use the File.Copy(srcFileName, destFileName) method if you get the image through a path, or Image.Save(destFileName) method if you are using the Image class.

Using streams "might" affect the image quality or "might" need a greater resource, thus reducing the performance of your application.
Share this answer

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