Mr_Green
Mr_Green

Reputation: 41832

copy an image and save it to other directory

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..

Upvotes: 6

Views: 29775

Answers (1)

middelpat
middelpat

Reputation: 2585

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

Upvotes: 28

Related Questions