 |
|
การ Resize Image ด้วย ASP <% function getimagesize(curwidth, curheight, ne |
|
 |
|
|
 |
 |
|
<%
function getimagesize(curwidth, curheight, newsizechange, newsizewhat, outputwh)
'##############################################
'Image Aspect Ratio Resize by Michael V Feranda
'##############################################
'curwidth -> This is the current width
'curheight -> This is the current height
'newsizechange -> This is the amount you want To ADD or take away
'newsizewhat -> This is what you want To ADD or take away the amount from (width or height)
'outputwh -> This is where you Select the new output size you want (width or height)
'Example of Use For a 800x600 image and change To a 640 width
' newwidth = getimagesize(800,600,-160,"width","width")
' newheight = getimagesize(800,600,-160,"width","height")
'##############################################
if ""& lcase(newsizewhat) &"" = "width" Then
resizeratio = newsizechange/(curwidth/100)
Else
resizeratio = newsizechange/(curheight/100)
End if
if ""& lcase(outputwh) &"" = "width" Then
getimagesize = cint(curwidth+((curwidth/100)*resizeratio))
Else
getimagesize = cint(curheight+((curheight/100)*resizeratio))
End if
End function
'Width: 800
'Height: 600
'I'm changing the width to 640 with the
' aspect ratio function
'To do this, i'll have to take away 160
' from 800, so I insert -160
%>
New Width: <%=getimagesize(800, 600, -160, "width", "width")%>
New Height: <%=getimagesize(800, 600, -160, "width", "height")%>

Tag : - - - -
|
|
 |
 |
 |
 |
Date :
6 มิ.ย. 2548 08:05:02 |
By :
nugul |
View :
2987 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ดีมั๊ก ๆเลยนะครับ
|
 |
 |
 |
 |
Date :
7 มิ.ย. 2548 19:55:35 |
By :
@W_IN |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อยากได้พอดีเลยครับ ขอบคุณมากๆครับผม 
|
 |
 |
 |
 |
Date :
5 ก.พ. 2549 14:11:19 |
By :
dev |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2009-06-30 11:24:59 |
By :
mrsitti |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|