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

no stretch

2 Answers 128 Views
BinaryImage
This is a migrated thread and some comments may be shown as answers.
Mohamadreza
Top achievements
Rank 1
Mohamadreza asked on 12 Feb 2014, 06:48 PM
hi
i have a radbinary image:
<telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" Width="340px"
               Height="340px" AutoAdjustImageControlSize="False" ResizeMode="Fit"/>
and show images dynamically:
Protected Sub RadButton2_Click(sender As Object, e As EventArgs) Handles RadButton2.Click
 
      Dim fac As printeryFalow = Session("invoiceData")
      RadBinaryImage1.ImageUrl = physicalToVirtualAddress(MsccRemoteProxyServer.clsGivers.getJpeg(fac.printeryInvoiceId))
      
  End Sub
but always showing all images in stretch mode. i want to show images in true ratio. i tested all options in resizemode property, but every options work the same.

2 Answers, 1 is accepted

Sort by
0
Accepted
Vasil
Telerik team
answered on 17 Feb 2014, 09:27 AM
Hello Mohamadreza,

The ResizeMode apply when the RadBinaryImage is bound to a DataSource. In this case the control reads the bytes for the image, and can do modifications of the image. When the browser request this image, the RadBinaryImage control will provide the modified version.

ResizeMode can not work when bound with ImageUrl, because in this case the control does not operate with the actual image, it only sends the URL to your browser, and the browser request it.

Regards,
Vasil
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 UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Shinu
Top achievements
Rank 2
answered on 17 Feb 2014, 12:01 PM
Hi Mohamadreza,

Please try to set AutoAdjustImageControlSize property of RadBinaryImage as true. this property scales the image based on explicitly set width/height dimensions to avoid stretch or blur effect when its original dimensions do not fit.

Thanks,
Shinu.
Tags
BinaryImage
Asked by
Mohamadreza
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Shinu
Top achievements
Rank 2
Share this question
or