02 Eyl

Convert Image To Byte Array in C#

This example shows how to convert an image into a byte array.

Sample Code:

        public byte[] ImageToByteArray(Image img)
        {
            MemoryStream ms = new MemoryStream();
            img.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
            return ms.ToArray();
        }

See Also:
Convert Byte Array To Image

1 thoughts on “Convert Image To Byte Array in C#

  1. Pingback: Convert Byte Array To Image in C# - C# Examples

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir


× six = 48