The following is a pretty good one
The code copy is as follows:
FunctionFormatImg2(content)
dimre
Setre=newRegExp
re.IgnoreCase=true
re.Global=True
re.Pattern="(script)"
Content=re.Replace(Content,"script")
re.Pattern="<img.[^>]*src(=|)(.[^>]*)>"
Content=re.replace(Content,"<imgsrc=$2style=""cursor:pointer""alt=""Click here to browse pictures in a new window""onclick=""javascript:window.open(this.src);""onload=""javascript:resizepic(this)""border=""0""/>")
setre=nothing
FormatImg=content
endfunction
The above is a bit bad, but the width and height in the picture are no longer there
The code copy is as follows:
Functiongetphoto(strHTML)
DimobjRegExp,Match,Matches
SetobjRegExp=NewRegexp
objRegExp.IgnoreCase=True
objRegExp.Global=True
objRegExp.Pattern="<img.+?>"
tp=""
SetMatches=objRegExp.Execute(strHTML)
ForEachMatchinMatches
tp=tp&Match.value
exitfor
Next
getphoto=tp
SetobjRegExp=Nothing
EndFunction
The following code is used to scale the image
The code copy is as follows:
functionResizeImage(imageid, limitWidth, limitHeight)
{
variable=newImage();
image.src=imageid.src;
if(image.width<=0&&image.height<=0)return;
if(image.width/image.height>=limitWidth/limitHeight)
{
if(image.width>limitWidth)
{
imageid.width=limitWidth;
imageid.height=(image.height*limitWidth)/image.width;