Image Centering Problem

M

Murdoc

Hi all,

I am currently using the server-side Image control to display images, with the image paths being
stored in an SQL database. Everything is working fine, but I have run into a small problem with the
image sizes. Currently, some images are smaller than others, and when they are displayed in the
control, they are stretched, and hence distorted.

Is there any way I can automatically centre the image without changing the size of the control? The
only other options I would have then, would be either modifying the size of the control for each
image, or resizing all the images.

--
Murdoc
; =================================
"Insanity in individuals is something rare - but in groups, parties, nations and epochs, it is the
rule."
-- Friedrich Nietzsche

"All Congresses and Parliaments have a kindly feeling for idiots, and a compassion for them, on
account of personal experience and heredity."
-- Mark Twain

"A single death is a tragedy, a million deaths is a statistic."
-- Joseph Stalin
 
K

Ken Cox [Microsoft MVP]

How about putting a single-cell table with a fixed sized and no borders
around the image control. Centre the contents of the cell with the align
attribute.

Then, don't set any image size for the image control so that it sizes itself
according to the image it gets. That way, the all of the images would take
up the same space but the smaller ones would appear in the centre.

Would that work?

Ken
 
M

Murdoc

Ken said:
How about putting a single-cell table with a fixed sized and no borders around the image control.
Centre the contents of the cell with the align attribute.

Then, don't set any image size for the image control so that it sizes itself according to the
image it gets. That way, the all of the images would take up the same space but the smaller ones
would appear in the centre.

Would that work?

Yeah, it will. Thanks. I didn't think it would be that simple.

--
Murdoc
; =================================
"Insanity in individuals is something rare - but in groups, parties, nations and epochs, it is the
rule."
-- Friedrich Nietzsche

"All Congresses and Parliaments have a kindly feeling for idiots, and a compassion for them, on
account of personal experience and heredity."
-- Mark Twain

"A single death is a tragedy, a million deaths is a statistic."
-- Joseph Stalin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top