Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

copy an image and save it to other directory

Tags:

c#

winforms

I am beginner in c#. In my project, if I do try the below code to save a copy of image, it is giving error "A generic error occurred in GDI+." . I have gone through this link, but I have no knowledge of what is he saying.

I tried the below code:

 Bitmap bmpLarge = new Bitmap(ofdFlagsLarge.FileName);
 bmpLarge.Save(@"\..\..\" + strLargePath);               /* ERROR */

Can someone please assist me to save a image from the local PC directory itself to other directory on the same machine..

like image 466
Mr_Green Avatar asked Oct 22 '12 13:10

Mr_Green


1 Answers

You just want to copy a file?

Why not use:

System.IO.File.Copy("source", "destination");

http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx

like image 65
middelpat Avatar answered Sep 28 '22 10:09

middelpat