Example #1
0
        public async void RefreshPseudoColor(int sub, string path, UInt16 gain, UInt16[] band, ColorRenderMode cMode)
        {
            this.Busy.isBusy = true;

            SubWinIndex = sub;
            colorBand   = band;
            colorMode   = cMode;
            for (int i = 0; i < 3; i++)
            {
                colorWave[i] = (UInt16)ImageInfo.getWave(colorBand[i]);
            }

            band[0] -= 1; band[1] -= 1; band[2] -= 1;
            Bitmap bmp = await BmpOper.MakePseudoColor2(sub, path, band, gain);

            band[0] += 1; band[1] += 1; band[2] += 1;
            if (bmp == null)
            {
                return;
            }
            bmp.RotateFlip(RotateFlipType.Rotate90FlipX);
            MemoryStream ms = new MemoryStream();

            bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
            ImgW = bmp.Width;
            ImgH = bmp.Height;

            BitmapImage bmpSource = new BitmapImage();

            bmpSource.BeginInit();
            bmpSource.StreamSource = ms;
            bmpSource.EndInit();
            this.IMG1.Source = bmpSource;
            viewSet();

            this.Busy.isBusy = false;
        }
Example #2
0
        //该函数仅用于显示图像内容
        public void RefreshImage(string path, int SubGridInedex, WinFunc setWinFunc, UInt16[] band, ColorRenderMode mode)
        {
            SubGrid[SubGridInedex].Children.Clear();
            WinFunc[SubGridInedex] = setWinFunc;

            UserControls[SubGridInedex] = new Ctrl_ImageView();
            ((Ctrl_ImageView)(UserControls[SubGridInedex])).RefreshPseudoColor(SubGridInedex, path, 1, band, mode);

            SubGrid[SubGridInedex].Children.Add(UserControls[SubGridInedex]);
        }