Using ResizeMode="Fit" with ImageUrl

3 posts, 0 answers
  1. Keith
    Keith avatar
    61 posts
    Member since:
    May 2008

    Posted 01 Nov 2010 Link to this post

    Accordining to http://www.telerik.com/help/aspnet-ajax/radbinaryimage.html 
    "ReziseMode" specifies whether the image should be sized automatically if width and height of the image are set in pixels. Possible values are:
    • Crop (the image will be trimmed)
    • Fit (the image will be sized to fit the given dimensions)
    • None (default)

    Using the code

    <

     

    telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" ImageUrl="Photo/Grid-Scrolling-Issue.jpg" ResizeMode="Fit" Height="100px" Width="100px"/>

     


    Renders

    <img id="RadBinaryImage1" src="Photo/Grid-Scrolling-Issue.jpg" style="height:100px;width:100px;" />

    and the image is 100x100 px on the page

    However, the file size downloaded to the browser is still its original file sze 1.25MB; which is not what we were hoping for. We would like to use the control to produce a thumbnail image that has a small file size and dimensions.Can this be done with the Binary image control?

    Our images are files on the server and not in a DB; that is why we went the ImageURL approach.

    Can the actual image size be reduced along with it's dimensions with this control, if so how?

    Thanks in advance,

    K.E.
  2. Craig Mellon
    Craig Mellon avatar
    53 posts
    Member since:
    May 2005

    Posted 03 Nov 2010 Link to this post

    I'm not so sure but I think you would do this on this fly - nothing to do with the Binary image control.

    As you know your image is allways going to be 100px by 100px resize the image to those dimensions before the RAD control renders the image, try this: Resize on fly
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 18 Nov 2010 Link to this post

    Hello Keith,

    I ResizeMode, I believe is only used when you have an image in the database, so it resizes the image and only sends an image with that size to the broswer. The ImageUrl property, I believe is just a fail-safe in case the image doesn't exists in the database. Almost like a default image to show when the correct image couldn't be found.

    I hope that helps.
Back to Top