How to convert image to byte array

前端 未结 12 1601
悲哀的现实
悲哀的现实 2020-11-22 09:52

Can anybody suggest how I can convert an image to a byte array and vice versa?

I\'m developing a WPF application and using a stream reader.

12条回答
  •  故里飘歌
    2020-11-22 10:41

    You can use File.ReadAllBytes() method to read any file into byte array. To write byte array into file, just use File.WriteAllBytes() method.

    Hope this helps.

    You can find more information and sample code here.

提交回复
热议问题