Picture Ratios

N

NEvans8993

Hi there,

I am currently pulling a .jpg file into an ASP DRW page based upon a
variable field which is linked to my access db. The image currently sits
within its own layer on the page. How do i go about coding so that whatever
picture is coming in via the db, it can automatically resize itself to fit
within the boundaries of the layer size, AND still keep its aspect ratio??

Thoughts welcome
 
M

Murray

it can automatically resize itself to fit
within the boundaries of the layer size, AND still keep its aspect ratio??

You cannot. At least you can't without some extensive js coding.

What I would do is to make sure that all of these pics were the same size by
adding canvas to the shorter dimensions on each image.
 
N

NEvans8993

Many thanks for your response. Could you poss explain this canvas thing a
little, and also what do you mean when you refer to 'the shorter
dimensions'???

Sorry, not very familiar with image components yet.

Cheers
 
T

Thomas A. Rowe

Set the image width value only (in HTML / Code view), however the layer must be able to
expand/collapse vertically.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
M

Murray

Even that will produce undesireable effects, I think. Sometimes, layers
don't stretch well. Of course, they always do when you don't want them to!
 
M

Murray

Let's say I have 2 images - one 140x300 and the other 155x254. 155 is the
greatest width, and 300 is the greatest height. Assuming I have a white
background where those images are to be placed on the page, I would use my
graphics program to make the first image sit on a white canvas that is
155x300. This would have the effect of giving that image a 7px white border
on one side and an 8px white border on the other side. I would then export
and use this image on the page in my layer which I would make 155x300px. I
would make the second image sit on a white canvas that is 155x300 which
would have the effect of a 23px white border above and below the image.

Using this method, all your images become 155x300px, and they all fit
perfectly within the layer.

Geddit?
 
T

Thomas A. Rowe

Since I don't use layers I wasn't sure if it would be possible, in which your solution would be the
best.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 

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

Top