Problem to convert byte array to double

后端 未结 3 2076
暗喜
暗喜 2021-01-26 07:44

I have a problem to convert an byte array to double array using BitConverter.ToDouble().

Simply my program will select an image then convert the image to by

3条回答
  •  太阳男子
    2021-01-26 08:26

    I think you need to back up a bit and explain what you are actually trying to do. Each BitConverter.ToDouble will convert 8 consecutive bytes into 1 double. If you start at the next position in the byte array, you are using 7 bytes that have already been used. Since each conversion will need 8 bytes, you will need to stop at Length - 7.

    Anyway, you are going to end up inflating the size of the data by a factor of 8.

    I think some explanation of what this is for might help you get some better answers.

提交回复
热议问题