Save DynamicImage

Jul 9, 2008 at 5:07 PM
How do I do to save my changed Image?
Coordinator
Jul 11, 2008 at 6:40 AM
You want to save your image from the browser? If so, you can right click it, and choose "Save image as..." option.

May I ask why do you want to do that?

Jul 11, 2008 at 8:35 AM

Sorry for this rather fuzzy question :)

What I mean is this:
I have a ASP.NET-application that I i intend to use like an ImageEditor, rotate/resize images.
And whith DynamicImage it was rather straight forward until i had processed my image and wants to save it, overwrite the original/save a copy (on the server) or perhaps save it in a database.

If i had an regular Image-object i have done like this, just to make it clear of what I want:

Dim bmp As New Drawing.Bitmap("orgFilepath")

bmp.Save("newFilepath", Drawing.Imaging.ImageFormat.Jpeg)

 


ra00l wrote:
You want to save your image from the browser? If so, you can right click it, and choose "Save image as..." option.

May I ask why do you want to do that?




Coordinator
Jul 11, 2008 at 3:52 PM
Hello; the dynamic image concept wasn't designed to support this feature (at least our design) because the image transformations are performed in-memory, memory that is released after the response output. Although, it might be a work around for your problem: the dynamic image supports server cache out-of-the-box so because the image is persisted in server cache, you might use it from there.

aspx - add server cache duration in minutes as much as possible
<piece:DynamicImage1 ... ServerCacheDuration="100"

code-behind - the cache key is the query string of the dynamic image src
protected void Button1_Click(object sender, EventArgs e)
{
    DynamicImageCacheItem cachedItem = this.Page.Cache[this.DynamicImage1.Src.Substring(this.DynamicImage1.Src.IndexOf("?") + 1)] as DynamicImageCacheItem;
    if (null != cachedItem)
    {
        Image image = cachedItem.Image;
    }
}

Let us know if you have any more issues.