Fit options

6 posts, 0 answers
  1. Simon
    Simon avatar
    32 posts
    Member since:
    Apr 2007

    Posted 20 Jul 2011 Link to this post

    Hello

    Love your new control. Cuts out the requirement for me to write an entire page to control the rotation, flipping, etc of an image. I would like to know if you could add a "Fit To Width", "Fit To Height" and "Fit Image" option so the image can fit to the width of the control, height of the control and then the width and height of the control.

    Regards,
    Simon
  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 22 Jul 2011 Link to this post

    Hi Simon,

    The Fit Image button is already available in the Zoom dialog.
    We will consider implementing the Fit to Width and Fit to Height commands for a future build of the control.

    Best regards,
    Rumen
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Art Handy
    Art Handy avatar
    11 posts
    Member since:
    Jun 2005

    Posted 10 Oct 2011 Link to this post

    I was wondering if you could also add the options:
    Best Fit, which would size the image to the height and width properties as best it can without distorting the image.
    Shrink To Fit, which would distort the image to fit the smaller height and width properties.
    Stretch to Fit, which would distort the image to fit the larger height and width properties.

  5. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 12 Oct 2011 Link to this post

    Hi Art,

    Thank you for your suggestions.

    I logged your requests in our PITS system. Here you can find the PITS Issue: Public URL. If more users request such features we will raise the priority of the item.


    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  6. Taran
    Taran avatar
    1 posts
    Member since:
    Apr 2014

    Posted 03 Apr 2014 in reply to Rumen Link to this post

    I am also interested in these functions, are there any updates on the implementation of "Fit to Width" and "Fit to Height"?
  7. Vessy
    Admin
    Vessy avatar
    1389 posts

    Posted 07 Apr 2014 Link to this post

    Hi Simon,

    RadImageEditor still does not offer the desired functionality out-of-the-box, but you can easily achieve it by using its Client-side API. For example, you can use a similar implementation:
    <asp:Button ID="button1" runat="server" OnClientClick="fitToHeight(); return false;" Text="Fit to Height" />
    <asp:Button ID="button2" runat="server" OnClientClick="fitToWidth(); return false;" Text="Fit to Width" />
    <telerik:RadImageEditor ID="RadImageEditor1" runat="server" ImageUrl="~/Images/Jellyfish.jpg">
    </telerik:RadImageEditor>
    <script>
        function fitToWidth() {
            var imEditor = $find("RadImageEditor1");
            var edElement = imEditor.getEditableElement();
            var viewPort = imEditor.get_viewport();
     
            imEditor.zoomImage((viewPort.offsetWidth / edElement.width) * 100)
        }
        function fitToHeight() {
            var imEditor = $find("RadImageEditor1");
            var edElement = imEditor.getEditableElement();
            var viewPort = imEditor.get_viewport();
     
            imEditor.zoomImage((viewPort.offsetHeight / edElement.height) * 100)
        }
    </script>

    In case you would like to add the above funtionality as custom tools, you cans see how this can be done here: Implement Custom Dialog and Insert Image Built-in Dialog

    I hope this information will be helpful for you.

    Kind regards,
    Vessy
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017