'Fit' ResizeMode stretches the image.

2 posts, 0 answers
  1. Corey
    Corey avatar
    1 posts
    Member since:
    May 2018

    Posted 03 Oct 2019 Link to this post

    Having a bit of trouble with the resize mode on the BinaryImage. I have specified the Width and Height in the aspx attributes and set the ResizeMode to fit, however it's just setting every image to the sizes that I specified rather than fitting them as it should be. This results in images being stretched rather than fit as if it's actually set to fill instead.

    I'm using an httphandler to serve the image from a database and this is the relevant code:

    Is there something that I'm missing here? Simply setting the ResizeMode to fit and setting a max height and width should be enough, right?

    <asp:Panel runat="server" Style="text-align:center;" >
                    <telerik:RadBinaryImage runat="server" ID="imgStu" ResizeMode="Fit" Width="1050" Height="700" />
                  </asp:Panel>

     

    imgStu.ImageUrl = "~/frm/ShowImage.ashx?id=" + strImageID;

  2. Eyup
    Admin
    Eyup avatar
    3901 posts

    Posted 08 Oct 2019 Link to this post

    Hello Corey,

     

    Your explanation is correct and generally, the Fit mode behaves exactly as you described. You can verify that in the following live sample:
    https://demos.telerik.com/aspnet-ajax/binaryimage/examples/resizemodes/defaultcs.aspx

    If this is not the case in your original project, there might be some CSS styling or AJAX hidden script issues involved:
    https://www.telerik.com/support/kb/aspnet-ajax/ajaxmanager/details/get-more-descriptive-errors-by-disabling-ajax

    Could you open a formal support thread to send us a very basic isolated runnable sample so we can reproduce the issue locally? This will enable us to further investigate the problem and provide more accurate and precise suggestions.

     

    Regards,
    Eyup
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top