This is a migrated thread and some comments may be shown as answers.

'Fit' ResizeMode stretches the image.

1 Answer 199 Views
BinaryImage
This is a migrated thread and some comments may be shown as answers.
Corey
Top achievements
Rank 1
Corey asked on 03 Oct 2019, 08:34 PM

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;

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 08 Oct 2019, 01:51 PM

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.
Tags
BinaryImage
Asked by
Corey
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or