Example #1
0
        private void MenuItemWorkClick(object sender, RoutedEventArgs e)
        {
            if (_firstPoints.Count != 3 || _secondPoints.Count != 3)
            {
                return;
            }

            using (var src = new Bitmap(_url.AbsolutePath))
            {
                var warpMatr = WarpMatrix.GetWarpMatrix(_firstPoints, _secondPoints);

                var filterType = TrilinearFiltering.GetReductionLevel(warpMatr) <= 1
                    ? FilterType.Bilinear
                    : FilterType.Trilinear;
                IFilter filter;
                switch (filterType)
                {
                case FilterType.None:
                    filter = new NoneFiltering(src, warpMatr);
                    break;

                case FilterType.Bilinear:
                    filter = new BilinealFiltering(src, warpMatr);
                    break;

                case FilterType.Trilinear:
                    filter = new TrilinearFiltering(src, warpMatr);
                    break;

                default:
                    filter = new NoneFiltering(src, warpMatr);
                    break;
                }

                img2.Source = ImageCreator.GetImage(filter);
            }
            ClearCanvas();
        }
 public ActionResult HelloAction()
 {
     ImageCreator creator = new ImageCreator();
     ImageSandpitModel model = new ImageSandpitModel();
     model.Image1 = creator.GetImage();
     return View(model);
 }