Convert image to binary?

前端 未结 8 2214
南旧
南旧 2021-02-08 04:07

I have an image (in .png format), and I want this picture to convert to binary.

How can this be done using C#?

8条回答
  •  礼貌的吻别
    2021-02-08 04:32

    byte[] b = File.ReadAllBytes(file);   
    

    File.ReadAllBytes Method

    Opens a binary file, reads the contents of the file into a byte array, and then closes the file.

提交回复
热议问题