以下はかなり良いものです
コードコピーは次のとおりです。
functionformatimg2(content)
薄暗い
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 =" "ここをクリックして、新しいウィンドウの写真を閲覧します" "onclick =" "javascript:window.open(this.src);" "onload =" "javascript:" "" "" "/"
setre =何もない
formatimg = content
エンド機能
上記は少し悪いですが、写真の幅と高さはもうそこにありません
コードコピーは次のとおりです。
functiongetphoto(strhtml)
dimobjregexp、マッチ、マッチ
setobjregexp = newRegexp
objregexp.ignorecase = true
objregexp.global = true
objregexp.pattern = "<img。+?>"
tp = ""
setMatches = objregexp.execute(strhtml)
foreachmatchinmatches
tp = tp&match.value
exitfor
次
getphoto = tp
setobjregexp =何も
エンド機能
次のコードを使用して画像をスケーリングします
コードコピーは次のとおりです。
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;