Does anyone have asp.net code sample that, using your WebResizingExtender, resizes a regular System.Web.UI.WebControl.Image component and retains the original aspect ratio? I can't figure out how to resize pictures without losing the aspect ratio.
Thank you so much. That got me going.
Hello Tappie,
Thank for posting in the Infragistics community !
It seems that there is no such property to support keeping the aspect ratio out of the box. Considering this I suggest that you handle the OnClientResize event and change the image height with the same ratio the width has changed with. Here is a sample code:
<img src=http://es.infragistics.com/samplesbrowser/samplescommon/aspnet/WebResizingExtender/Display/ResizingImages/image9.jpg alt="Image" id="Image1" runat="server" width="320" height="240" />
<igui:WebResizingExtender ID="resizer" TargetControlID="Image1" OnClientResize="Resize" runat="server" />
................
function Resize(e, args) {
var widthChangeRatio = args.getWidth() / args.getOldWidth();
args.setHeight(args.getOldHeight() * widthChangeRatio);
}
Please let me know if you have further questions on the matter.