当前位置: 首页 > 图文教程 > 网络编程 > ASP > 水印测试(重新测试)

ASP
用ASP编写网络传呼机
用ASP+CSS实现随机背景
ASP下载系统防盗链方法
用ASP编写下载网页中所有资源的程序
Request.ServerVariables应用
解决Asp程序的Server.CreateObject错误
ASP实现TCP端口扫描的方法
源码实例:ASP实现远程保存图片
用ASP+DLL实现WEB方式修改服务器时间
ASP使用MySQL数据库全攻略
ASP+SQL Server构建网页防火墙
教程/ASP 十天学会ASP之第二天
教程/ASP 十天学会ASP之第四天
教程/ASP 十天学会ASP之第五天
教程/ASP 十天学会ASP之第六天
教程/ASP 十天学会ASP之第七天
教程/ASP 十天学会ASP之第八天
教程/ASP 十天学会ASP之第九天
教程/ASP 十天学会ASP之第十天
关于学习ASP和编程的28个观点

ASP 中的 水印测试(重新测试)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-12   浏览: 32 ::
收藏到网摘: n/a

注:如果你是用Fireworks来处理LOGO图片,在导出图片的时候用Alpha透明而不要用索引透明!
Dim Jpeg,Logo
Set Jpeg = Server.CreateObject("/upload/tech/20091012/20091012011636_03afdbd66e7929b125f8597834fa83a4.jpeg")
Jpeg.Open Server.MapPath(UploadDir&Request2.Form("LocalImage"))'打开图片
'添加文字水印
'Jpeg.Canvas.Font.Color = &HFF0000' 红色
'Jpeg.Canvas.Font.Family = "Verdana"
'Jpeg.Canvas.Font.Size = 15
'Jpeg.Canvas.Font.ShadowColor = &HCCCCCC '水印文字的阴影色彩。
'Jpeg.Canvas.Font.ShadowXoffset = 2 '阴影右偏移,负值则左偏移。
'Jpeg.Canvas.Font.ShadowYoffset = 2 '阴影下偏移,负值则右偏移。
'Jpeg.Canvas.Font.Quality = 1 '水印文字清晰度,从0~4
'Jpeg.Canvas.Font.ShadowColor = &H999999
'Jpeg.Canvas.Pen.Width = 1
'Jpeg.Canvas.Brush.Solid = True
'Jpeg.Canvas.Font.Bold = True
'Jpeg.Canvas.Print Jpeg.width-171, Jpeg.height-38, "blog.goalerCN.com"
'Jpeg.Canvas.Print Jpeg.width-201, Jpeg.height-20, "Copyright (c) Goaler's BLOG"
'添加水印图片
Set Logo = Server.CreateObject("/upload/tech/20091012/20091012011636_03afdbd66e7929b125f8597834fa83a4.jpeg")
Logo.Open Server.MapPath("/upload/tech/20091012/20091012011637_63dc7ed1010d3c3b8269faf0ba7491d4.gif")
IF(Jpeg.width-8>Logo.width AND Jpeg.height-8>Logo.height)THEN
Logo.Sharpen 0.7,120
Jpeg.DrawImage Jpeg.width-Logo.width-8,Jpeg.height-Logo.height-8,Logo,1,&HFFFFFF'抽取掉白色背景,水印位于右下角
Jpeg.Save Server.MapPath(UploadDir&Request2.Form("LocalImage"))'保存文件
END IF
Set Logo = Nothing'注销对象
Set Jpeg = Nothing'注销对象