rnorthedge
11/19/2004 9:36:00 AM
Hello,
I am fairly new to GDI+ so forgive me if this is a simple question. I
have searched on the newsgroups and cannot find an answer.
In C# I am creating a new Bitmap object:
Bitmap oBannerImage = new Bitmap(610, 60);
Graphics oBannerGraphics = Graphics.FromImage(oBannerImage);
and then using the Graphics object to draw a load of stuff into the
image.
At the end, if I do
oBannerImage.Save("C:\banner.gif");
then I get a small (7K), good quality image file. However, I would
like to save the image data into a MemoryStream instead, to manipulate
the bytes further. Unfortunately there is no Save overload that takes
just a Stream; I need to use the overload that uses a Stream and an
ImageFormat object. But I do not know what ImageFormat object to use
to get the same results as I am getting from the Save method with the
filename alone. Can anyone tell me what format the
oBannerImage.Save("C:\banner.gif"); call uses by default, so I can
reproduce the same 7K image into a stream? I have used
ImageFormat.Gif (this gives a low quality image), ImageFormat.Bmp
(this gives a higher quality image but with a much bigger file size).
Any help greatly appreciated
Thanks,
Richard