Berikut ini adalah yang cukup bagus
Salinan kode adalah sebagai berikut:
FunctionFormatMg2 (konten)
dimre
Setre = newregexp
re.ignorecase = true
re.global = true
re.pattern = "(skrip)"
Konten = re.replace (konten, "skrip")
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 = tidak ada
FormatIMG = konten
fungsi endfungsi
Di atas agak buruk, tetapi lebar dan tinggi pada gambar tidak ada lagi
Salinan kode adalah sebagai berikut:
FunctionGetPhoto (strhtml)
DimoBjregexp, pertandingan, pertandingan
Setobjregexp = newregexp
objregexp.ignorecase = true
objregexp.global = true
objregexp.pattern = "<img.+?>"
tp = ""
SetMatches = objregexp.execute (strhtml)
ForeachMatchInmatches
TP = TP & Match.Value
keluar
Berikutnya
getPhoto = tp
Setobjregexp = tidak ada
Fungsi endfungsi
Kode berikut digunakan untuk mengukur gambar
Salinan kode adalah sebagai berikut:
FunctionResizeImage (ImageId, LimitWidth, Limitheight)
{
variabel = 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;