Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confining Image Size (Keeping Proportions) 1

Status
Not open for further replies.

BoulderBum

Programmer
Jul 11, 2002
2,179
US
Lets say I have an image that's 200x150 pixels, and I want to fit it into, say, a table cell that is 100x100. Is there a static way to confine the image to the cell's size (keeping the proportions of the image) without hard-coding pixel sizes?

In the above case (where I'm looking to fit the 200x150 image into the 100x100 space), I'd need a way to automatically shrink the image to 100x75.

The reason I can't hard-code the shrunk image size beforehand is because I don't know the size until runtime.

[COLOR=blue gainsboro]
Get a FREE iPod by helping me get mine! Click my referrer link:

More about the company and deal:
[/color]
 
you will need to use javascript forum216 It's probably been asked a few times.

or ASP.NET, PHP with the graphics library installed or ASP with an image component installed.



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top