给图片加上水印

给图片加上水印,要用水印组件,主要有两个,aspjpeg和wsImage。这里介绍的是aspjpeg2.0。

点此下载ASPJPEG2.0

安装和使用见:http://www.jb51.net/article/13323.htm

这里介绍一个使用aspjgeg给图片加水印的例子。

<%
Set Jpeg = Server.CreateObject("Persits.Jpeg")
' Open source image
Jpeg.Open Server.MapPath("images/apple.jpg")

' Resizing is optional. None in this code sample.

' Draw text
Jpeg.Canvas.Font.Color = &HFF0000 ' Red
Jpeg.Canvas.Font.Family = "Courier New"
Jpeg.Canvas.Font.Bold = True
Jpeg.Canvas.Font.Quality = 4 ' Antialiased
Jpeg.Canvas.Font.BkMode = "Opaque" ' to make antialiasing work
Jpeg.Canvas.Print 10, 10, "Copyright (c) XYZ, Inc."

' Draw frame: black, 2-pixel width
Jpeg.Canvas.Pen.Color = &H000000 ' Black
Jpeg.Canvas.Pen.Width = 2
Jpeg.Canvas.Brush.Solid = False ' or a solid bar would be drawn
Jpeg.Canvas.DrawBar 1, 1, Jpeg.Width, Jpeg.Height

Jpeg.Save Server.MapPath("test.jpg")
%>

 

test

posted on 2009-10-30 23:37  网络小筑  阅读(281)  评论(0编辑  收藏  举报

导航