Scale Images without stretching

4 posts, 0 answers
  1. Alex
    Alex avatar
    16 posts
    Member since:
    Nov 2013

    Posted 30 Nov 2013 Link to this post

    Is there a way to scale a Rad Rotator image proportionally without stretching it? I basically want an image to take up the entirety of the rotator's box with no white-space on the X or Y axis, but I don't want the image to be distorted. It works now when I tell the image/item to have 100% width, but if any image is REALLY wide, I have whitespace on the top and bottom of the fixed-size rotator. The same applies if I size an image/item with 100% height... I just want the whole screen -filled- regardless of the dimensions of the image, but no stretching.

    This is for a full-screen rotator that displays images on a TV, where the administrator simply drags images into a folder.
  2. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 04 Dec 2013 Link to this post

    Hi Alex,

    The RadRotator cannot handle this type of resizing of the images in its items out-of-the-box. My suggestion is that you prepare on the server a version of every uploaded image that will fit in the viewport of the rotator. Then the RadRotator control can be databound with the new images in order to display them without gaps.

    Regards,
    Slav
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Alex
    Alex avatar
    16 posts
    Member since:
    Nov 2013

    Posted 04 Dec 2013 Link to this post

    Thanks for the reply. What I'd really like to know is if anyone knew of any sort of third-party javascript(s) to accomplish this. I know radrotator itself can't do it
  5. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 09 Dec 2013 Link to this post

    Hello Alex,

    It is recommended to perform such modifications of the images on the server-side. For this purpose you can utilize the server-side API of the RadImageEditor and more specifically the EditableImage class. In the help article EditableImage Members (section RadImageEditor EditableImage Methods) you can find more information about the available methods for modifying the images. The one you will need in this scenario is Resize.

    Regards,
    Slav
    Telerik
    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 the blog feed now.
Back to Top