Writing Metadata Property to Tiff Images

D

dalabera

Hi, I had the following snippet to save a tiff file with the property
tag of fillorder wich I need for a fax application:

Bitmap i = (Bitmap)Image.FromFile(dlg.FileName);
PropertyItem proitem = i.GetPropertyItem(258);
byte[] bValue = {1};
proitem.Id = 266;
proitem.Len = 1;
proitem.Type = 3;
proitem.Value = bValue;
i.SetPropertyItem( proitem );
EncoderParameters ep2=new EncoderParameters(2);
Encoder enc3=Encoder.ScanMethod ;
ep2.Param[0]=new EncoderParameter(enc,(long)EncoderValue.MultiFrame
);
ep2.Param[1]=new
EncoderParameter(enc2,(long)EncoderValue.CompressionCCITT3);

i.Save(Path.GetFileNameWithoutExtension(dlg.FileName)+"_2.tif",info,ep2);

//printValues(i);
i.Dispose();

The problem I have that before the save I check via debug that the
image have the property tag however when I save it the property I just
added had disappear.
Anyone could help me or tell me If I'm doing something wrong would
really appreaciate.
Thanks
jb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top