最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
aspjpeg 图片加文字水印
时间:2022-06-29 14:24:23 编辑:袖梨 来源:一聚教程网
' 水印文字
' intdirection:图片位置:
' 如果传进来的是数组 array(left,top):
' left 表示水印图片相对源图的左上角x方向距离
' top 表示水印图片相对源图的左上角y方向距离
' 如果是单一数字:
' 1:左上 2:上中 3:右上 4:左中 5:中中 6:右中 7:左下 8:中下 9:右下
' intleft 表示水印文字相对源图的左上角x方向距离
' inttop 表示水印文字相对源图的左上角y方向距离
' strtext 水印文字
public sub drawtext(intdirection,strtext)
dim objjpeg2
dim intwidth
dim intheight
dim intleft
dim inttop
message = ""
if fileisopen then
intwidth = intjpegwidth
intheight = intjpegheight
if intwidthif not isarray(intdirection) then
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
with objjpeg.canvas
.font.color = intjpegcolor
.font.family = strjpegfamily
.font.bold = flagjpegbold
.font.size = intjpegsize*2
.print intleft,inttop,strtext
end with
if err then
message = "打文字水印出错!"
end if
else
message = "图片太小或水印区域过大!"
end if
else
message = "文件没有打开!"
end if
end sub
%>
相关文章
- 不思议迷宫神农试炼怎么过 05-17
- 《支付宝》蚂蚁庄园6月18日答案2022 05-17
- 欢乐钓鱼大师体验模式怎么开启 05-17
- 不思议迷宫咒灵试炼怎么过 05-17
- 崩坏星穹铁道如狼成就怎么获取 05-17
- DNF手游安图恩困难模式怎么打 DNF手游安图恩困难模式攻略技巧 05-17