Forums - C# Corner

Forum guidelines
zozo ahmed

zozo ahmed

  • 1.3k
  • 18
  • 9.4k

convert each location from array of bytes to double

Jan 7 2014 1:11 PM
I need to convert each location of bytes arrays to double ,it can not run with Bitconverter:
byte[,] R = new byte[width, height]; 
byte[,] G = new byte[width, height]; 
byte[,] B = new byte[width, height]; 
double[,] Y1 = new double[width, height]; 
for (int x = 0; x < width; x++) 
 for (int y = 0; y < height; y++) 
    { 
           double ee = BitConverter.ToDouble(R[x, y], x, y);
 double ee1 = BitConverter.ToDouble(G[x, y], x, y); 
           double ee2 = BitConverter.ToDouble(B[x, y], x, y); 
           Y1[x, y] = (0.39 * ee) + (0.59 * ee1) + (0.12 * ee2);
}
Is there method for convert each location of byte array to double??


Answers (1)

Download Free eBooks

SPONSORED BY

File APIs for .NET
Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more!