• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to make images the right size?

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

i have an issue concerning html/webdesign. Let's say i have a collection of images of which i don't know the size. I iterate over the collection to display the images. These images can be in all shapes and sizes. Is it possible to resize these images in order for them to be displayed on the screen properly?? So that one image will not take up the full screen and another will be hardly vissible.

Thanks for the info.

P.S. perhaps i can give the user the possibility to click on a link which generates a popup containing the image, so resizing will be no issue. But i prefer to show the images immediately.
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can set fixed width="" and height="" attributes on <img> tag but images will be resized roughtly (by the browser).
 
Ricardo Estafan
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know you can set fixed width and height, but if you don't know the shape of an image it is not possible to set width and height fixed. In that you never know what the result will be. This can be a rather awkward image if you set the width and height fixed.
 
Eugene Lucash
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Images of different shapes.. let me think round, triangle, star-shaped

you can align (lineup) them for example by height

<img src="ttt.gif" height="100" alt="ttt" />
<img src="vvv.gif" height="100" alt="vvv" />

ttt.gif and vvv.gif a different sized and with different aspect ratio
but they appered in same height preserving aspect ratio

If you want some smarter aligning it is not trivial task.
Your program will need more artifical intelligence...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic