示例#1
0
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                var tiffs = TiffHelper.ReadDoubleByteTiff(@"D:\gaoqi\原始图像\tif\hengzhe.tif");

                var bmps = TiffHelper.SliceVetically(tiffs[0], 2);

                bmps = TiffHelper.SliceVetically(@"D:\gaoqi\原始图像\tif\hengzhe.tif", 2);

                var bmp1 = TiffHelper.ConvertTiffInfoToBitmap(bmps[0]);
                var bmp2 = TiffHelper.ConvertTiffInfoToBitmap(bmps[1]);

                TiffImage1.Source = BitmapToBitmapImage(bmp1);
                TiffImage2.Source = BitmapToBitmapImage(bmp2);

                var tiff1 = bmps[0];
                var tiff2 = bmps[1];

                TiffHelper.Create16BitGrayScaleTiff(tiff1.UshortBuffer, tiff1.Width, tiff1.Height, @"\tif\NewTiff1.tiff");
                TiffHelper.Create16BitGrayScaleTiff(tiff2.UshortBuffer, tiff2.Width, tiff2.Height, @"\tif\NewTiff2.tiff");
            }
            catch (Exception e)
            {
                Tracer.Exception(e);
            }
        }