Hi Earl,
Sorry about that. The answer is there, but not directly. It's in an article
about saving JPEGs with a specific compression
(http://www.bobpowell.net/jpeg_compression.htm). The EncoderParameters
array is included in 2 overloads of the base Image class Save method, in
your case, the overload that takes a stream as an argument:
System.Drawing.Image.Save(System.IO.Stream,
System.Drawing.Imaging.ImageCodecInfo,
System.Drawing.Imaging.EncoderParameters)
(http://msdn2.microsoft.com/en-gb/library/ms142148(VS.80).aspx)
The System.Drawing.Imaging.ImageCodecInfo class
(http://msdn2.microsoft.com/en-gb/library/system.drawing.imaging.imagecodecinfo(V
S.80).aspx)
is easy to create, using the static ImageCodecInfo.GetEncoders method, and
using a MIME string. Here's a method that creates one:
public static ImageCodecInfo GetEncoderInfo(string mimeType)
{
int intCt;
ImageCodecInfo[] aryEncoders = ImageCodecInfo.GetImageEncoders();
for (intCt = 0; intCt < aryEncoders.Length; intCt++)
{
if (aryEncoders[intCt].MimeType == mimeType)
return aryEncoders[intCt];
}
throw new Exception("MimeType '" + mimeType + "' not found");
}
In the case of a BitMap, you would use "image/bmp" as the MIME string:
ImageCodeInfo codecInfo = GetEncoderInfo("image/bmp");
As to the EncoderParameters, the Encoder class
(http://msdn2.microsoft.com/en-gb/library/system.drawing.imaging.encoderparameter
(VS.80).aspx)
provides a parameter for the image encoder used by the Save method, and you
can create and use any number of them. The constructor for EncoderParameter
usually takes an Encoder
(http://msdn2.microsoft.com/en-gb/library/system.drawing.imaging.encoder.encoder(
VS.80).aspx)
and a value. There are a number of constructor overloads
(http://msdn2.microsoft.com/en-gb/library/system.drawing.imaging.encoder.encoder(
VS.80).aspx)
to handle the different types of Encoders
(http://msdn2.microsoft.com/en-gb/library/system.drawing.imaging.encoder_members(
VS.80).aspx)
available. The most commonly-used values for Encoders can be found in the
System.Drawing.Imaging.EncoderValue enumeration
(http://msdn2.microsoft.com/en-gb/library/system.drawing.imaging.encodervalue(VS.
80).aspx).

Signature
HTH,
Kevin Spencer
Microsoft MVP
Logostician
http://unclechutney.blogspot.com
Parabola is a mate of plane.
> Thanks Kevin, I'd already read most of Bob's stuff and I didn't find
> anything directly on point.
[quoted text clipped - 19 lines]
>>> arrayImage = ms.GetBuffer();
>>> ms.Close();
Earl - 03 Dec 2006 01:10 GMT
Thanks for the links. I'm sure they will come in handy.
> Hi Earl,
>
[quoted text clipped - 68 lines]
>>>> arrayImage = ms.GetBuffer();
>>>> ms.Close();