Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ian 22 posts 72 karma points
    Jun 13, 2013 @ 17:11
    Ian
    0

    Media.AfterSave

    Hi

    Im trying to amend an image on the Media.AfterSave method, i have accessed it but when i come to save the Image it says its unable to access the file, as its blocked by another processcan anyone help or a generic GDI+ error?

     

    string orgPath = fileprop.Value.ToString();
    string path = HttpContext.Current.Server.MapPath(orgPath);
    string[] splitPath = orgPath.Split('.');
    string temporaryFilename = splitPath[0] + "_cnr." + splitPath[1];
    string tempFilePath = HttpContext.Current.Server.MapPath(temporaryFilename);
    
    Image umbImage = System.Drawing.Image.FromFile(path);
    int cornerRadius = 10;
    if(umbImage.Width > 250)
        cornerRadius = 30;
    
    Image RoundedImage = ImageCorners.RoundCorners(umbImage, cornerRadius, Color.White, false, false, true, true);
    
    RoundedImage.Save(path, ImageFormat.Gif);

    Ian

Please Sign in or register to post replies

Write your reply to:

Draft