最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp aspjpeg图片增加图片水印代码
时间:2022-06-30 11:07:11 编辑:袖梨 来源:一聚教程网
图片水印
' intdirection:图片位置:
' 如果传进来的是数组 array(left,top):
' left 表示水印图片相对源图的左上角x方向距离
' top 表示水印图片相对源图的左上角y方向距离
' 如果是单一数字:
' 1:左上 2:上中 3:右上 4:左中 5:中中 6:右中 7:左下 8:中下 9:右下
' strfilename:用做水印图片的文件名
public sub drawimage(intdirection,strfilename)
dim objjpeg2
dim intwidth
dim intheight
dim intleft
dim inttop
message = ""
if fileisopen then
if objfso.fileexists(server.mappath(strfilename)) then
on error resume next
set objjpeg2 = server.createobject("persits.jpeg")
with objjpeg2
.open server.mappath(strfilename)
if err then
message = err.description
end if
if intjpegor intjpegthen
intwidth = .originalwidth
intheight = .originalheight
else
intwidth = intjpegwidth
intheight = intjpegheight
end if
if intwidth
select case intdirection
case 1
intleft = 0
inttop = 0
case 2
intleft = (width-intwidth)/2
inttop = 0
case 3
intleft = width-intwidth
inttop = 0
case 4
intleft = 0
inttop = (height-intheight)/2
case 5
intleft = (width-intwidth)/2
inttop = (height-intheight)/2
case 6
intleft = width-intwidth
inttop = (height-intheight)/2
case 7
intleft = 0
inttop = height-intheight
case 8
intleft = (width-intwidth)/2
inttop = height-intheight
case else
intleft = width-intwidth
inttop = height-intheight
end select
else
intleft = intdirection(0)
inttop = intdirection(1)
end if
on error resume next
objjpeg.drawimage intleft,inttop,objjpeg2,floatjpegopacity,intjpegcolor
if err then
message = "打图片水印出错!"
end if
else
message = "水印图片像素过大!"
end if
end with
else
message = "水印图片不存在!"
end if
else
message = "文件没有打开!"
end if
end sub
%>
相关文章
- 《艾塔纪元》武器升级怎么样 06-16
- DYθR 创始人深度剖析:解密代币价格涨跌背后的群体行为密码 06-16
- 最新正规全球交易所2025数字资产交易榜单-最安全虚拟币交易app币安推荐 06-16
- 《空之要塞:启航》完美链接第四十一关怎么通关最快 06-16
- 《世界之外》柏源循此极乐侧影有哪些 06-16
- 2025最热门币圈十大现货交易平台TOP10-低手续费币圈交易所币安推荐 06-16