asp水印组件之AspJpeg的结合代码实例(2)


Response.Write Jpeg.Expires


注册成功则到期时间为:9999-9-9
否则为:安装日期加1个月期限

7、如何用AspJpeg组件生成图片缩略图?
<% 
Set Jpeg = Server.CreateObject("Persits.Jpeg") '创建实例
Path = Server.MapPath("../images/apple.jpg") '处理图片路径
Jpeg.Open Path '打开图片
'调整宽度和高度为原来的50%
Jpeg.Width = Jpeg.OriginalWidth / 2
Jpeg.Height = Jpeg.OriginalHeight / 2
Jpeg.Save Server.MapPath("apple_small.jpg") '保存图片到磁盘
Jpeg.Close:Set Jpeg = Nothing
%>


8、如何用AspJpeg组件生成图片水印?
<% 
Set Jpeg = Server.CreateObject("Persits.Jpeg") 
Jpeg.Open Server.MapPath("images/dodge_viper.jpg") 
开始写文字 
Jpeg.Canvas.Font.Color = &000000'' red 颜色 
Jpeg.Canvas.Font.Family = "Courier New" 字体 
Jpeg.Canvas.Font.Bold = True 是否加粗 
Jpeg.Canvas.Print 10, 10, "Copyright (c) XYZ, Inc." 
打印坐标x 打印坐标y 需要打印的字符 
以下是对图片进行边框处理 
Jpeg.Canvas.Pen.Color = &H000000'' black 颜色 
Jpeg.Canvas.Pen.Width = 2 画笔宽度 
Jpeg.Canvas.Brush.Solid = False 是否加粗处理 
Jpeg.Canvas.Bar 1, 1, Jpeg.Width, Jpeg.Height 
起始X坐标 起始Y坐标 输入长度 输入高度 
Jpeg.Save Server.MapPath("images/dodge_viper_framed.jpg") 保存 
%>


9、如何用AspJpeg组件进行图片合并?
AspJpeg 1.3+ enables you to place images on top of each other via the method DrawImage. To use this method, you must create two instances of the AspJpeg objects and populate both of them with images via calls to Open (or OpenBinary). When calling Canvas.DrawImage, the 2nd instance of AspJpeg is passed as an argument to this method, along with the X and Y offsets (in pixels): 
使用该方法,您必需创建两个AspJpeg实例对象
<%
Set Jpeg1 = Server.CreateObject("Persits.Jpeg")
Set Jpeg2 = Server.CreateObject("Persits.Jpeg")
Jpeg1.Open Server.MapPath("t.jpg")
Jpeg2.Open Server.MapPath("t1.jpg")
Jpeg1.Canvas.DrawImage 10, 10, Jpeg2 ' optional arguments omitted
jpeg1.save Server.mappath("tt.jpg")

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2608.html