다음은 꽤 좋은 것입니다
코드 사본은 다음과 같습니다.
functionformatimg2 (컨텐츠)
딤 스
setre = newRegexp
re.ignorecase = true
re.global = true
re.pattern = "(스크립트)" "
content = re.replace (콘텐츠, "스크립트")
re.pattern = "<img. [^>]*src (= |) (. [^>]*)>"> "
content = re.replace (content, "<imgsrc = $ 2style =" "Cursor : Pointer" "Alt =" "새 창에서 그림을 찾으려면 여기를 클릭하십시오" "onclick =" "javaScript : window.open (this.src);" "onload ="javaScript (thists)
setre = 아무것도
formatimg = 내용
최종 기능 장애
위는 약간 나쁘지만 그림의 너비와 높이는 더 이상 없습니다.
코드 사본은 다음과 같습니다.
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 = 아무것도 없습니다
최종 기능 장애
다음 코드는 이미지를 스케일링하는 데 사용됩니다
코드 사본은 다음과 같습니다.
functionsizeImage (imageId, limiteight, limitheight)
{
변수 = NewImage ();
image.src = imageId.src;
if (image.width <= 0 && image.height <= 0) 리턴;
if (image.width/image.height> = limitwidth/limitheight)
{
if (image.width> limitwidth)
{
imageId.width = limitwidth;
imageId.height = (image.height*limitwidth)/image.width;