Help setting property items to a gif file

  • Thread starter Thread starter Alexey Titov
  • Start date Start date
A

Alexey Titov

Hi.

I got this problem working with gif images - trying to alter one image's
property

1. System.Drawing.Image image1 =
System.Drawing.Image.FromFile("c:\\Photo1.gif");
2. System.Drawing.Image image2 =
System.Drawing.Image.FromFile("c:\\Photo2.gif");

3. PropertyItem propertyitem1 = image1.GetPropertyItem(0x5100);
4. PropertyItem propertyitem2 = image2.GetPropertyItem(0x5100);

// both propertyitems are created and have values

5. image2.SetPropertyItem(propItem1); - It throws an exception - 'Property
is not supported' - but the properyitem was created in step 4!

(both images were created using
.... Bitmap pBitmap;
....
.... pBitmap.Save(pOutputfilename, ImageFormat.Gif);)

PS. Similar code for JPEG with ...GetPropertyItem(#) works fine

TIA
 
Peter,
Thanks for your reply.

Those two images indeed had 1 frame.
Now I tried a 5 frame gif from Wiki and tried same code on it and it's
copy - and got same error.
But property does indeed exist in both images - it got ID, Type, Length and
Value = array of 20 elements 100, 0, 0, 0, 50, 0, 0, 0 ... -
just as normal description for gif frame delay times (4 items per frame).

Regards,
Alexey
 
Back
Top