该功能用于在自定义SQL中根据参数缩小图片
修改自 kesion.label.sqlcls.asp 红色为添加部分
调用说明 {$CreateImage({$Field(photourl,Text,0,...,0,)},{$Param(1)},{$Param(2)})} 第一个参数为图片地址,第2个和第3个为宽和高
GetCirLabelContent=GetCirLabelContent &TempStr
Else
Exit For
End If
KS_RS_Obj.MoveNext
Next
GetCirLabelContent=MySplitField(GetCirLabelContent)
GetCirLabelContent=CreateImage(GetCirLabelContent)
GetCirLabelContent=CurrClassPosition(GetCirLabelContent)
GetCirLabelContent=CurrInfoPosition(GetCirLabelContent)
End Function
Function CreateImage(lpFieldValue)
Dim regEx, Matches, Match
if instr(lpFieldValue,"CreateImage")<=0 then
CreateImage=lpFieldValue
else
Dim FieldParam,FieldParamArr,mytempValue,mytempNum,mytarget,templpFieldValue,file,filepath,filename,filebasename,fileextname
Dim T:Set T=New Thumb
Set regEx = New RegExp
regEx.Pattern = "{\$CreateImage\([^{\$}]*}"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(lpFieldValue)
For Each Match In Matches
FieldParam = Replace(Replace(Match.Value,"{$CreateImage(",""),")}","")
FieldParamArr = Split(FieldParam,",")
file=FieldParamArr(0)
filepath=left(file,instrrev(file,"/"))
filename=mid(file,instrrev(file,"/")+1)
filebasename=split(filename,".")(0)
call T.CreateThumb(FieldParamArr(0),FieldParamArr(1),FieldParamArr(2),1,0,filepath&filebasename&"_S.jpg")
lpFieldValue=Replace(lpFieldValue,Match.Value,filepath&filebasename&"_S.jpg")
Next
CreateImage=lpFieldValue
end if
End Function
地址:http://www.aqwzjs.com/html/algl/list_497.html