Esempio n. 1
0
 protected void _cropCommand_Click(object sender, EventArgs e)
 {
     try
     {
         var    x         = int.Parse(_xField.Value);
         var    y         = int.Parse(_yField.Value);
         var    width     = int.Parse(_widthField.Value);
         var    height    = int.Parse(_heightField.Value);
         string imageName = Convert.ToString(ViewState["ImageToBeEdit"]);
         string source    = Server.MapPath("~/Modules/Sage_Banner/images/OriginalImage/" + imageName);
         string dest      = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Default/");
         InterceptImageController.ResizeBannerImageAndCrop(source, width, height, dest, imageName);
         string soruceFolder = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Default/");
         string SourcePath   = soruceFolder + imageName;
         string thumbMedium  = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Medium/");
         string thumbSmall   = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Small/");
         string thumbLarge   = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Large/");
         InterceptImageController.ResizeBannerImage(SourcePath, 965, thumbLarge, imageName);
         InterceptImageController.ResizeBannerImage(SourcePath, 768, thumbMedium, imageName);
         InterceptImageController.ResizeBannerImage(SourcePath, 320, thumbSmall, imageName);
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
     divImageEditor.Attributes.Add("style", "display:none");
     pnlBannercontainer.Attributes.Add("style", "display:block");
     ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/Sage_Banner/ModuleLocalText", "ImageEditedSuccesfully"), "", SageMessageType.Success);
 }