最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
aspjpeg 图片加文字水印
时间:2010-10-27 编辑:简简单单 来源:一聚教程网
' 水印文字
' 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
%>
相关文章
- aspjpeg组件图片加文字图片水印 在线图片剪切 比例放大缩小图片 10-27
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16