Michael
Michael

Reputation: 13614

A generic error occurred in GDI+ exception

I have few rows of VB.NET code:

   Dim dest As String = "C:\Users\Yonapms1\Desktop\Sample Pictures2"
   Dim img As Bitmap = New Bitmap("C:\Users\Yonapms1\Desktop\Sample Pictures\Tulips.jpg")

    img.Save(dest)

In img.Save(dest) row I get this exception:

Any idea why i get this exeption?

A generic error occurred in GDI+.

Thank you in advance.

Upvotes: 0

Views: 420

Answers (1)

Teppic
Teppic

Reputation: 2546

It looks like you might be trying to move the image from a folder called "Sample Pictures" to another folder called "Sample Pictures2". If so, you are better off doing the following:

File.Move("C:\Users\Yonapms1\Desktop\Sample Pictures\Tulips.jpg", "C:\Users\Yonapms1\Desktop\Sample Pictures2\Tulips.jpg")

Upvotes: 2

Related Questions