Hello Sirs,
I am having a BMP loadet into a picturebox. This I'd like to save on
my harddisk as a GIF:
picturebox1.Ima ge.Save("C:\\DA TA\\PICTURES\\t estpic.gif",
ImageFormat.Gif );
However, this GIF-file is not in very good quality.
Using "Irfanview" , I can change a BMP-file to GIF in quite better
quality setting an option called "save interlaced".
How am I going to do that using C#?
I have allready tried:
EncoderParamete rs encparams = new
EncoderParamete rs(1);
encparams.Param[0] = new
EncoderParamete r(System.Drawin g.Imaging.Encod er.ColorDepth, 256L);
ImageCodecInfo[] imcodecinfo =
ImageCodecInfo. GetImageEncoder s();
picturebox1.Ima ge.Save(("C:\\D ATA\\PICTURES\
\testpic.gif", imcodecinfo[0], encparams);
and more of the kind: Encoder.Compres sion, Encoder.Quality , etc.
This actually solves the problem, no matter what value I put after the
Encoder."someth ing": (16L, 32L, 256L - why the "L" by the way??)
The only problem here is, that this GIF-file i about 7 times as big as
nessasary.
The GIF file saved with the "ImageFormat.Gi f" is 24 Kb.
The GIF made with Irfanview interlaced is 56 Kb (and this has the
quality I need).
Using these EncoderParamete rs, the GIF ends up being 359 Kb.
This is a problem! By different reasons it is important that the files
are as small as possible, and I have to use GIF.
The fact that Irfanview can do this, tells me it can be done.
Can anybody in here tell me how?
Thank you very much in advance.
Sincerely / Best regards
Mads Aggerholm