예제 #1
0
        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));
        }
예제 #2
0
        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));
        }