SaaS CMS has officially launched! Learn more now.

ImageVault Resize Images



i am using ImageVault in my application.

I want to resize image through c# code i.e i want to show existing image in less size without loosing quality.

Anybody has idea?




Mar 11, 2011 12:13

You can use ImageVault's UrlBuilder class to generate a link to a resized version of the image. If you have the URL to the original image (for example retrieved from an ImageVaultImage property) you can use it like this to return the URL to a resized version:

var ub = ImageStoreNET.Classes.Util.UrlBuilder.ParseUrl(imageUrl);
ub.Width = 400;
ub.PreserveAspectRatio = true;
return ub.ToString();

Mar 11, 2011 13:08

Thanks Magnus

Mar 11, 2011 16:09

Hi Magnus

I want to specify Height and Width in resize like

var ub = ImageStoreNET.Classes.Util.UrlBuilder.ParseUrl(imageUrl);
ub.Width = 636;


ub.PreserveAspectRatio = true;
return ub.ToString();

But i am not able to get resized image with specified size.Any idea?


Mar 29, 2011 6:25

You can't force both Width and Height and preserve the aspect ratio, that would mean streching the pixels. I'm not sure which of width and height it will obey if you set it to preserve aspect ratio, but the output width/height ratio will be the same as the original width/height.

Mar 29, 2011 6:46

Ok ,than i can specify Aspect Ration to achieve this

ub.Width = 636;

ub.Height = 369;


Mar 29, 2011 6:57

If you want to distort the image I suppose you ould set Width, Height and then set PreserveAspectRatio to false.

Mar 29, 2011 8:36

Thanks Magnus

I am able to get desired image.

One more thing,If i have Episerver Property

 <EPiServer:Property ID="imgTopImage" runat="server" PropertyName="TopImage" />

Than how we can do resizing because we are not able to set Url from codebehind?







Mar 31, 2011 11:01

It responds to hidden attributes, fx.

<EPiServer:Property ImageWidth="100" ID="imgTopImage" runat="server" PropertyName="TopImage" />

Aug 08, 2011 12:38
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.