Example #1
0
    protected void ResizeImage(object sender, EventArgs e)
    {
        int width  = ResizeWidth.Text.TryParseInt();
        int height = ResizeHeight.Text.TryParseInt();

        ImageMedia img = ImageMedia.Create(File.ReadAllBytes(FileImageFolder + ImageList.SelectedValue));

        img.Resize(width, height);
        File.Delete(FileImageFolder + ImageList.SelectedValue);
        File.WriteAllBytes(FileImageFolder + ImageList.SelectedValue, img.ToByteArray());

        ResizeMessage.Text = Resource.Admin_CKEditor_ImageResized;
        SelectImage(null, null);
    }
Example #2
0
    protected void ResizeImage(object sender, EventArgs e)
    {
        int width  = Util.Parse <int>(ResizeWidth.Text);
        int height = Util.Parse <int>(ResizeHeight.Text);

        ImageMedia img = ImageMedia.Create(File.ReadAllBytes(FileImageFolder + ImageList.SelectedValue));

        img.Resize(width, height);
        File.Delete(FileImageFolder + ImageList.SelectedValue);
        File.WriteAllBytes(FileImageFolder + ImageList.SelectedValue, img.ToByteArray());

        ResizeMessage.Text = "Image successfully resized!";
        SelectImage(null, null);
    }
Example #3
0
    protected void ResizeImage(object sender, EventArgs e)
    {
        ATMT_AttachmentBLL att = new ATMT_AttachmentBLL(new Guid(ImageList.SelectedValue));
        int width  = Util.Parse <int>(ResizeWidth.Text);
        int height = Util.Parse <int>(ResizeHeight.Text);

        ImageMedia img = ImageMedia.Create(att.GetData());

        img.Resize(width, height);

        att.UploadFileData(img.ToByteArray());

        ResizeMessage.Text = "Image successfully resized!";
        SelectImage(null, null);
    }
        public string ResizeImage(CKEditorModel model)
        {
            _modObj = model;

            _modObj.ImageFolder = (model.DirectoryList == "Root" ? "" : "\\" + model.DirectoryList);
            _modObj.ImageURL    = _modObj.ImageFolder + "\\" + _modObj.ImageList;

            int width  = Util.Parse <int>(_modObj.ResizeWidth);
            int height = Util.Parse <int>(_modObj.ResizeHeight);

            ImageMedia img = ImageMedia.Create(System.IO.File.ReadAllBytes(_modObj.ImageURL));

            img.Resize(width, height);
            System.IO.File.Delete(_modObj.ImageURL);
            System.IO.File.WriteAllBytes(_modObj.ImageURL, img.ToByteArray());

            return("true");
        }