response.write "<img height=80 width=100 src='" & rs("img") & '">"

解决方案 »

  1.   

    同意楼上的,只怕littleBenhorse不是这个意思吧
      

  2.   

    谢谢各位!我想表达的意思是,能有一个单选栏,用户可以选择现实图片的尺寸,代码如下,那位大哥能给改一下,谢谢了!
    <%@LANGUAGE="VBSCRIPT"%>
    <!--#include file="Connections/CONNSQL.asp" -->
    <%
    set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_CONNSQL_STRING
    Recordset1.Source = "SELECT * FROM dbo.SHOW"
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 3
    Recordset1.Open()
    Recordset1_numRows = 0
    %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp; </p>
    <img src="<%=(Recordset1.Fields.Item("S_PICURL").Value)%>" width="100" height="80"> 
    <form name="form1" method="post" action="">
      <input type="radio" name="radiobutton" value="radiobutton">
      100*80 
      <input type="radio" name="radiobutton" value="radiobutton">
      200*160 
      <input type="submit" name="Submit" value=" 确认修改">
    </form>
    </body>
    </html>
    <%
    Recordset1.Close()
    %>
    %>
      

  3.   

    如果是为了显示效果完全可以象net_lover(孟子E章)那样来控制啊
    但是如果你想通过html来把图片的大小改了
    那好象是不可能啊<script>
    function ca()
    {
    for (i=0;i<document.images.length;i++)
    {
    document.images[i].style.width=100
    document.images[i].style.height=80
    }
    }
    </script>
    <img src="sd.gif">
    <img src="sd.gif">
    <input type="Button" onclick="ca()">
      

  4.   

    自动获得图片的宽度与高度,并且自动按比例缩小<!-- #include file="db.inc" -->
    <%
    '---------------------------------------RETURN THE IMAGE FORMAT--------------------
    function checkImageFormat(checkdata)
    '--return: A,B,C (A is image format; B is height pixels; C is width pixels; D is color depth) flag=0 '''''''0 is not jpg/gif/png image; 1 is jpg/gif/png'-------------------------------------------------------check jpg----------------
    if flag=0 then 
    tempstr=Leftb(checkdata,10)
    tstr=chrb(255)&chrb(216)&chrb(255)&chrb(224)&chrb(0)&chrb(16)&chrb(74)&chrb(70)&chrb(73)&chrb(70)if strcomp(tempstr,tstr,0)=0 then
    msgstr01="jpg"
    lngSize = len(checkdata)
    flgFound = 0strTarget = chrb(255) & chrb(216) & chrb(255)
    flgFound = instrb(checkdata, strTarget)lngPos = flgFound + 2
    ExitLoop = falsedo while ExitLoop = False and lngPos < lngSizedo while ascb(midb(checkdata, lngPos, 1)) = 255 and lngPos < lngSize
    lngPos = lngPos + 1
    loopif ascb(midb(checkdata, lngPos, 1)) < 192 or ascb(midb(checkdata, lngPos, 1)) > 195 then
    lngMarkerSize = lngConvert2(midb(checkdata, lngPos + 1, 2))
    lngPos = lngPos + lngMarkerSize + 1
    else
    ExitLoop = True
    end ifloopi_Height = lngConvert2(midb(checkdata, lngPos +4, 2))
    i_Width = lngConvert2(midb(checkdata, lngPos +6, 2))
    i_Depth = 2 ^ (ascb(midb(checkdata, lngPos + 8, 1)) * 8)msgstr02=","& i_height & "," & i_width
    flag=2
    else
    flag=0
    end if
    end if
    '--------------------------------------------------check gif--------------------------------
    if flag=0 then
    tempstr=Leftb(checkdata,6)
    tstr=chrb(71)&chrb(73)&chrb(70)&chrb(56)&chrb(57)&chrb(97)
    tstr2=chrb(71)&chrb(73)&chrb(70)&chrb(56)&chrb(55)&chrb(97)
    if strcomp(tempstr,tstr,0)=0 or strcomp(tempstr,tstr2)=0 then
    msgstr03="gif"i_width=lngConvert(midb(checkdata,7,2))
    i_height=lngConvert(midb(checkdata,9,2))
    i_Depth = 2 ^ ((ascb(midb(checkdata, 11, 1)) and 7) + 1)
    msgstr04=","& i_height & ","& i_width flag=2
    else 
    flag=0
    end if
    end if'---------------------------------------------------check png------------------------------
    if flag=0 then 
    tempstr=Leftb(checkdata,4)
    tstr=chrb(137)&chrb(80)&chrb(78)&chrb(71)
    if strcomp(tempstr,tstr,0)=0 then
    msgstr05="png"i_Width = lngConvert2(midb(checkdata, 19, 2))
    i_Height = lngConvert2(midb(checkdata, 23, 2))
    i_Depth = lngConvert(midb(checkdata, 25, 2))select case ascb(right(i_Depth,1))
    case 0
    i_Depth = 2 ^ (asc(left(i_Depth, 1)))
    gfxSpex = True
    case 2
    i_Depth = 2 ^ (asc(left(i_Depth, 1)) * 3)
    gfxSpex = True
    case 3
    i_Depth = 2 ^ (asc(left(i_Depth, 1))) '8
    gfxSpex = True
    case 4
    i_Depth = 2 ^ (asc(left(i_Depth, 1)) * 2)
    gfxSpex = True
    case 6
    i_Depth = 2 ^ (asc(left(i_Depth, 1)) * 4)
    gfxSpex = True
    case else
    i_Depth = -1
    end select
    msgstr06=","& i_height & ","& i_widthflag=2
    else 
    flag=0
    end if
    end if
    if flag=0 then 
    msgstr07="no image"
    end if
    msgstr=msgstr01 & msgstr02 & msgstr03 & msgstr04 & msgstr05 & msgstr06 & msgstr07checkImageFormat=msgstr
    end functionfunction lngConvert2(strTemp)
    str1=leftb(strTemp,1)
    str2=rightb(strTemp,1)
    lngConvert2 = clng(ascb(str2) + ((ascb(str1) * 256)))
    end functionfunction lngConvert(strTemp)
    str1=leftb(strTemp,1)
    str2=rightb(strTemp,1)
    len1=ascb(str1)
    len2=ascb(str2)
    lngConvert = clng(ascb(str1) + ascb(str2) * 256)
    end functionFormSize = Request.TotalBytes 
    FormData = Request.BinaryRead( FormSize )function ImageUp(formsize,formdata) 
    bncrlf=chrb(13) & chrb(10) 
    divider=leftb(formdata,instrb(formdata,bncrlf)-1)
    datastart=instrb(formdata,bncrlf&bncrlf)+4
    dataend=instrb(datastart+1,formdata,divider)-datastart
    imageup=midb(formdata,datastart,dataend)
    end functionImage=ImageUp (FormSize,Formdata) arrayMessage=split(checkImageFormat(image),",")
    '*********************************%><% 
    'on error resume next
    if arrayMessage(1)>600 OR arrayMessage(2)>500 then%> 
    <script language="javascript">
    alert("您所选择的图片的尺寸不符合要求!应在 高*宽 600*500 之间,请重新选择图片!另外注意图片只能从本地目录上传!")
    self.close()
    </script>
    <% Else
    ......
    <%End if%> 
    -----------------------------------------------------------------
    主要看中间三段
    check jpg
    check gif
    check png