微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ASP中配置Kindeditor上传图片选择添加水印功能

第1步:修改plugins下的image/image.js

找到'<input type="button" class="ke-upload-button" value="' + lang.upload + '" />',

在其下面加上

'<label width:60px;">是否水印</label>',                                          //自己添加的定义配置水印功能代码配置上传图片选择添加水印功能

'<input id="wateradd" type="checkBox" value="1" name="wateradd"/>',//自己添加的定义配置水印功能代码配置上传图片选择添加水印功能

第2步:修改upload_json.asp

找到"fileUrl = saveUrl & file.filename"

在下面加上代码

'自己添加的定义配置水印功能代码开始

dim wateradd

wateradd = upload.forms("wateradd")

if wateradd<>"" then

Dim Photo,PhotoPath,iWidth,iHeight,iiwidth,iiheight

Set Photo = Server.CreateObject("Persits.Jpeg") 

PhotoPath = Server.MapPath(fileUrl) 

Photo.Open PhotoPath 

Photo.Interpolation=1 

Photo.Quality=100

iWidth=Photo.OriginalWidth 

iHeight=Photo.OriginalHeight 

iiwidth=170

iiheight=41

Photo.Canvas.DrawPNG iWidth-iiWidth-15,iHeight-iiHeight-15,Server.MapPath("../../images/watermark.png")

Photo.save Server.mappath(fileUrl)

end if

'自己添加的定义配置水印功能代码结束

第3步:修改页面代码

allowImageUpload : true,

allowFileManager : true, 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐