Why don't just write the bytes directly to physical file? Creating an image
object isn't necessary.
System.IO.File.WriteAllBytes("myfile.jpg", byteArray);
On Mon, Aug 30, 2010 at 12:38 PM, Benj Nunez <[email protected]> wrote:
> Hi
>
> Since you have indicated that your byte[] buffer contains a JPEG
> image and you want to save it
> to the same format you can try this:
>
>
> MemoryStream ms = new MemoryStream(myByteArray);
> Image i = Image.FromStream(ms);
> i.Save("myfile.jpg", ImageFormat.Jpeg);
>
>
>
>
> where "myByteArray" is your byte[] buffer.
>
>
>
> Regards,
>
>
> Benj
>
>
> On Aug 29, 10:57 pm, bill <[email protected]> wrote:
> > Hi All,
> >
> > I have a byte[] buffer that contains a JPEG image - how do I save it
> > to a JPEG file - myfile.jpg? I suppose this is pretty simple, but my
> > C# is very rusty!
> >
> > TIA,
> >
> > Bill
>