• aspjpeg 打水印


    1.asp

    ==

    <%
     ' create a thumbnail from an image stored in the database
     ' This code sample requires AspJpeg 1.2+

     ' Using ADO, open database with an image blob
     strConnect = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("../db/aspjpeg.mdb")

     Set rs = Server.CreateObject("adodb.recordset")
     SQL = "select image_blob from images2 where id = " & Request("id")
     rs.Open SQL, strConnect, 1, 3
     

     Set Jpeg = Server.CreateObject("Persits.Jpeg")
     
     LocalFile="d:/w.jpg"
    Dim Jpeg
    Set Jpeg = Server.CreateObject("Persits.Jpeg")
    If Err.Number=-2147221005 then
    Response.write "没有这个组件,请安装!"'检查是否安装AspJpeg组件
    Response.End()
    End If
    Jpeg.Open (LocalFile)'打开图片
    If err.number then
    Response.write"打开图片失败,请检查路径!"
    Response.End()
    End if
    Dim TempA '原始图片的二进制数据
    TempA=Jpeg.Binary'将原始数据赋给TempA

     ' Open image directly from recordset
     Jpeg.OpenBinary TempA

     ' resize
     jpeg.Width = Request("Width")

     ' Set new height, preserve original width/height ratio
     jpeg.Height = jpeg.OriginalHeight * jpeg.Width / jpeg.OriginalWidth

     ' apply sharpening
     Jpeg.Sharpen 1, 110


     Jpeg.SendBinary

     rs.Close
    %>

    ==

    2.asp ==输出JPG

    <HTML>
    <HEAD>
    <TITLE>AspJpeg Manual Chapter 2 - Thumbnails from the Database</TITLE>
    </HEAD>
    <BODY>
    <h2>Thumbnails directly from a database-stored image</h2>
    <%
    For Width = 100 to 400 Step 100
    %>

    <IMG SRC="2.asp?width=<% = Width %>&id=1"><P>

    <%
    Next
    %>

    </BODY>
    </HTML>

    ===

  • 相关阅读:
    css3 animation 点亮灯光效果
    setTimeout和setInterval
    红绿灯 promise和原始方式实现
    思考3
    转载: 理解Javascript执行过程
    tapable
    SVG: 将 svg 导出成图片
    ES6: Module:
    d3 插值-实现一个简单的 animation
    three.js开发指南(第三版)_案例源码
  • 原文地址:https://www.cnblogs.com/y0umer/p/3839436.html
Copyright © 2020-2023  润新知