Exemplo n.º 1
0
        public ActionResult CreateStep2(ImageView model)
        {
            var image = WebImage.GetImageFromRequest();

            if (image != null)
            {
                if (image.Width > 500)
                {
                    image.Resize(500, ((500 * image.Height) / image.Width));
                }

                var filename = Path.GetFileName(image.FileName);
                image.Save(Path.Combine(BlogGlobals.TemporaryImageFolder, filename));
                filename = Path.Combine(BlogGlobals.TemporaryImageFolder, filename);

                model.ImageUrl = Url.Content(filename);

                var imageInput = new ImageInput()
                {
                    Image = model,
                    Width = image.Width,
                    Height = image.Height,

                    Top = image.Height * 0.1,
                    Left = image.Width * 0.9,
                    Right = image.Width * 0.9,
                    Bottom = image.Height * 0.9
                };

                return View("CreateStep2", imageInput);

            }

            return RedirectToAction("CreateStep1");
            //return View("CreateStep1", model);
        }
Exemplo n.º 2
0
 //
 // GET: /Slide/Create
 public ActionResult CreateStep1()
 {
     ImageView SlideImage = new ImageView();
     return View(SlideImage);
 }