AdvancedOCR.BitmapConverter.ToBitmap C# (CSharp) Method

ToBitmap() public static method

public static ToBitmap ( this doubles, int width ) : Bitmap
doubles this
width int
return System.Drawing.Bitmap
        public static Bitmap ToBitmap(this double[] doubles, int width)
        {
            if (width <= 0) throw new ArgumentException();
            int length = doubles.Length;
            int height = (length + width - 1) / width;

            Bitmap result = new Bitmap(width, height, PixelFormat.Format32bppPArgb);
            for (int i = 0; i < length; i++)
            {
                result.SetPixel(i % width, i / width, ToPixel(doubles[i]));
            }
            return result;
        }