BitmapSource Arr2Source(byte[,] input, ColorCovMode colomod) { ColorConvertMethod cv = new ColorConvertMethod(); byte[] flatMatrix = input.Flatten <byte>(); Color[] rainbowArr = cv.ConvertColor(colomod)(flatMatrix); ArrayToImage convertor = new ArrayToImage(input.GetLength(1), input.GetLength(0)); System.Drawing.Bitmap imgbit = new System.Drawing.Bitmap(input.GetLength(1), input.GetLength(0)); convertor.Convert(rainbowArr, out imgbit); return(CreateBitmapSourceClass.ToWpfBitmap(imgbit)); }
BitmapSource CreateColoredImgVector(byte [] byteMatrix, int width, int height, ColorCovMode colormod) { ColorConvertMethod cv = new ColorConvertMethod(); byte[] flatMatrix = byteMatrix; Color[] colorArr = cv.ConvertColor(colormod)(flatMatrix); ArrayToImage convertor = new ArrayToImage(width, height); System.Drawing.Bitmap imgbit = new System.Drawing.Bitmap(width, height); convertor.Convert(colorArr, out imgbit); return(CreateBitmapSourceClass.ToWpfBitmap(imgbit)); }