Forums
This topic is locked
Dynamically resize an image
Posted 30 Jun 2002 22:19:04
1
has voted
30 Jun 2002 22:19:04 Russell Marshall posted:
I am trying to use the information at www.udzone.com/ShowDetail.asp?NewsId=483
to resize images on an ASP site.
I have added the following
<!--#INCLUDE FILE='imgsz.asp'-->
<!--#INCLUDE FILE='propresize.asp'-->
copied the files to the same directory as the page requiring image resizing and altered the img src line as instructed.
The original SRC line read as follows.
<img src="logon/prodimages/<%=(RS_Detail.Fields.Item("image".Value)%>" width="250" height="190" border="2">
The instructions tell me to modify the line as follows.
Now to resize our image, we need to follow this syntax:
<img src="image.gif" <%=ImageResize(Server.MapPath("image.gif", height, width)%>>
The Server.MapPath declaration should match your src exactly.
This will invoke the filesystem object, test the image's height and width, and then force the largest side to fit into the smallest dimension.
I mdified the line as follows.
<img src="logon/prodimages/<%=(RS_Detail.Fields.Item("image".Value)%>" <%=ImageResize(Server.MapPath("logon/prodimages/<%=(RS_Detail.Fields.Item("image".Value)%>", height, width)%>
Unfortunately this does not work.
Has anyone successfully followed this tutorial and if so what have I done wrong. Is it a syntax problem?
Regards
Davrus