网站程序不能生成缩略图,求助
来源:百度知道 编辑:UC知道 时间:2024/06/09 17:54:36
' Author : henry lu
' 生成缩略图,参数:源图路径,目标图路径,宽度,高度,是否裁剪标记:0否,1是
Function SaveThumbPic(ByVal strSrcImagePath, ByVal strDstImagePath, _
ByVal intMaxWidth, ByVal intMaxHeight, ByVal intCropFlag)
Dim Jpeg,fs,FilePath
Dim intImageWidth, intImageHeight
Dim intThumbWidth, intThumbHeight
On Error Resume Next
if instr(strSrcImagePath,":")<>2 then strSrcImagePath=Server.MapPath(strSrcImagePath)
if instr(strDstImagePath,":")<>2 then strDstImagePath=Server.MapPath(strDstImagePath)
'默认长宽是0
if intMaxWidth="" or not isNumeric(intMaxWidth) then intMaxWidth=0
if intMaxHeight="" or not isNumeric(intMaxHeight) then intMaxHeight=0
intMaxWidth=cint(intMaxWidth)
intMaxHeight=cint(intMaxHeight)
'长宽中有一项省略时,取另一项的值
if intMaxWidt
重发一下代码,刚才发的不全
' Author : henry lu
' 生成缩略图,参数:源图路径,目标图路径,宽度,高度,是否裁剪标记:0否,1是
Function SaveThumbPic(ByVal strSrcImagePath, ByVal strDstImagePath, _
ByVal intMaxWidth, ByVal intMaxHeight, ByVal intCropFlag)
Dim Jpeg,fs,FilePath
Dim intImageWidth, intImageHeight
Dim intThumbWidth, intThumbHeight
On Error Resume Next
if instr(strSrcImagePath,":")<>2 then strSrcImagePath=Server.MapPath(strSrcImagePath)
if instr(strDstImagePath,":")<>2 then strDstImagePath=Server.MapPath(strDstImagePath)
'默认长宽是0
if intMaxWidth="" or not isNumeric(intMaxWidth) then intMaxWidth=0
if intMaxHeight="" or not isNumeric(intMaxHeight) then intMaxHeight=0
intMaxWidth=cint(intMaxWidth)
intMaxHeight=cint(intMaxHeight)
'长宽中有一项省略时,取另一项的值
if intMaxWidth=0 then intMaxWidth=intMaxHeight
if intMaxHeight=0 then intMaxHei