|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Create jpg from byte array of raw image dataI have a byte array of 24-bit image data. I want to compress the data as jpg
and write it to a stream. Is there any easy and fast way to do this in C#? byte[] rawImageData = new byte[width*height *3]; // imagedata is filled with rgb pixel info byte[] jpgImageData = ??? // compressed rawImageData (with header) myStream.Write(jpgImageData); Hi Cynthia,
Solution: http://www.glennjones.net/Post/799/Highqualitydynamicallyresizedimageswithnet.htm Do exactly as Glenn prescribes, but don't resize. Best regards, -- Li-fan Show quote "Cynthia" <Cynt***@discussions.microsoft.com> wrote in message news:4446F441-68AE-479B-A11F-41949322E422@microsoft.com... > I have a byte array of 24-bit image data. I want to compress the data as jpg > and write it to a stream. Is there any easy and fast way to do this in C#? > > byte[] rawImageData = new byte[width*height *3]; > // imagedata is filled with rgb pixel info > > byte[] jpgImageData = ??? // compressed rawImageData (with header) > > myStream.Write(jpgImageData); > > |
|||||||||||||||||||||||