Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET JScript.NET
hi,
 
I have a few certain sizes of image displaying areas on my website. If I use image aspect ratio to re size the image and then display on the website according to the display area size then it does resizing in the aspect ratio but the size which is fixed for displaying on the website is lost.
 
For instance, if the want to display a logo image whose original size in width and height is 250 x 100 but when I re size with aspect ration and display on the website in a square shape then it loses on desired height and width and displays it in smaller in height and stretches in width which apparently looks like lost pixels image. Please note that aspect ratio is maintained principally but the background of the square does not get occupied fully when I upload a rectangle logo image.
 
I just simply want to display all the logo images in the square shape with the predefined size to fit all the images equally & occupy the full square area and not leave blank space of the square area or the background whatever the size of the image may be.
 
Thanks in advance.
Posted 19-Apr-13 22:31pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

image_handler best solution for your query
 
alternative code
Resize-and-Compress-Image-in-Csharp see this also
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 215
1 George Jonsson 175
2 Kornfeld Eliyahu Peter 159
3 PIEBALDconsult 110
4 Richard MacCutchan 85
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 20 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100