コード例 #1
0
ファイル: MainModule.cs プロジェクト: pimier15/BigImageViewer
        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));
        }