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?
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();
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?
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.
Ok ,than i can specify Aspect Ration to achieve this
ub.Width = 636;
ub.Height = 369;
If you want to distort the image I suppose you ould set Width, Height and then set PreserveAspectRatio to false.
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?
It responds to hidden attributes, fx.
<EPiServer:Property ImageWidth="100" ID="imgTopImage" runat="server" PropertyName="TopImage" />