温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:功能很全asp.net图片水印组件源码2.0
当前文件:
ImageWaterMark/Config_XML.aspx,打开代码结构图
ImageWaterMark/Config_XML.aspx,打开代码结构图
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Config_XML.aspx.cs" Inherits="PanRoor.XML" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=gb2311">
<title>无标题页</title>
<script language='JavaScript'>
function SelectColor(sEL,form){
var dEL = document.all(sEL);
var url = 'selcolor.aspx?color='+encodeURIComponent(sEL);
var arr = showModalDialog(url,window,'dialogWidth:280px;dialogHeight:250px;help:no;scroll:no;status:no');
if (arr) {
form.value=arr;
//sEL.style.backgroundColor=arr;
form.style.backgroundColor=arr;
form.style.color=arr;
}
}
</script>
<link href="style.css" type="text/css" rel=stylesheet />
</head>
<body style="text-align: center" bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0">
<form id="form1" runat="server">
<table align="center" border="0" cellpadding="5" cellspacing="0" class="tableBorder"
width="98%">
<tr>
<th colspan="4" height="25">
基本设置</th>
</tr>
<tr>
<td align="right" style="width: 20%">
水印功能</td>
<td align="right" style="text-align: left; width: 330px;">
<asp:RadioButtonList ID="rb_NoAndOff" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
RepeatLayout="Flow">
<asp:ListItem Value="true">启用</asp:ListItem>
<asp:ListItem Value="false">禁用</asp:ListItem>
</asp:RadioButtonList></td>
<td align="right" width="40%">
自定义文字水印阴影深度<span style="color: #ff0000">X</span>轴</td>
<td width="60%">
<asp:TextBox ID="tb_ShadowX" runat="server" Width="45px"></asp:TextBox>像素</td>
</tr>
<tr style="color: #000000">
<td align="right" class="forumRowHighlight" style="width: 20%">
水印类型</td>
<td align="right" class="forumRowHighlight" style="text-align: left; width: 330px;">
<asp:RadioButtonList ID="rb_PicAndText" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
RepeatLayout="Flow">
<asp:ListItem Value="pic">图片</asp:ListItem>
<asp:ListItem Value="text">文字</asp:ListItem>
</asp:RadioButtonList></td>
<td align="right" class="forumRowHighlight">
自定义文字水印阴影深度<span style="color: #ff0000">Y</span>轴</td>
<td class="forumRowHighlight">
<asp:TextBox ID="tb_ShadowY" runat="server" Width="45px"></asp:TextBox>像素</td>
</tr>
<tr>
<td align="right" style="width: 20%">
水印图片路径
</td>
<td align="right" style="text-align: left; width: 330px;">
<asp:TextBox ID="tb_picpath" runat="server" Width="193px"></asp:TextBox></td>
<td align="right" id="TD1">
自定义水印位置<span style="color: #ff0000">X</span>轴</td>
<td>
<asp:TextBox ID="tb_PlaceX" runat="server" Width="45px"></asp:TextBox>像素</td>
</tr>
<tr style="color: #000000">
<td align="right" class="forumRowHighlight" style="height: 34px; width: 20%;">
水印文字</td>
<td align="right" class="forumRowHighlight" style="height: 34px; text-align: left; width: 330px;">
<asp:TextBox ID="tb_WM_Text" runat="server" Width="145px"></asp:TextBox></td>
<td align="right" class="forumRowHighlight" style="height: 34px">
自定义水印位置<span style="color: #ff0000">Y</span>轴</td>
<td class="forumRowHighlight" style="height: 34px">
<asp:TextBox ID="tb_PlaceY" runat="server" Width="45px"></asp:TextBox>像素</td>
</tr>
<tr>
<td align="right" style="width: 20%">
水印位置</td>
<td align="right" style="text-align: left; width: 330px;">
<asp:DropDownList ID="ddl_Location" runat="server">
<asp:ListItem Value="LeftTop">左上角</asp:ListItem>
<asp:ListItem Value="LeftBottom">左下角</asp:ListItem>
<asp:ListItem Value="Center">居中</asp:ListItem>
<asp:ListItem Value="RightTop">右上角</asp:ListItem>
<asp:ListItem Value="RightBottom">右下角</asp:ListItem>
<asp:ListItem Value="CenterTop">上居中</asp:ListItem>
<asp:ListItem Value="CenterBottom">下居中</asp:ListItem>
<asp:ListItem Value="CenterLeft">左居中</asp:ListItem>
<asp:ListItem Value="CenterRight">右居中</asp:ListItem>
</asp:DropDownList></td>
<td align="right">
自定义缩略图宽度</td>
<td>
<asp:TextBox ID="tb_MinWidth" runat="server" Width="45px"></asp:TextBox>像素</td>
</tr>
<tr>
<td align="right" class="forumRowHighlight" style="width: 20%">
水印透明度</td>
<td align="right" class="forumRowHighlight" style="text-align: left; width: 330px;">
<asp:TextBox ID="tb_Transparence" runat="server" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px" MaxLength="3" Height="20px"></asp:TextBox>%
<span style="color: #ff0000; font-size:8pt">* 最大值为100</span></td>
<td align="right" class="forumRowHighlight">
自定义缩略图高度</td>
<td class="forumRowHighlight">
<asp:TextBox ID="tb_MinHeight" runat="server" Width="45px"></asp:TextBox>像素</td>
</tr>
<tr>
<td align="right" style="width: 20%">
文字阴影模糊透明度</td>
<td align="right" style="width: 330px; text-align: left">
<asp:TextBox ID="Txtshadowtransparence" runat="server" Height="20px" MaxLength="3" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px" ></asp:TextBox>% <span style="font-size: 8pt; color: #ff0000">* 最大值为100</span></td>
<td align="right">
图像质量</td>
<td >
<asp:TextBox ID="PicVal" runat="server" Height="20px" MaxLength="3" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px"></asp:TextBox>% <span style="font-size: 8pt; color: #ff0000">* 最大值为100</span></td>
</tr>
<tr>
<td align="right" class="forumRowHighlight" style="width: 20%">
马赛克效果</td>
<td align="right" class="forumRowHighlight" style="width: 330px; text-align: left">
<asp:RadioButtonList ID="Mosaic" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
RepeatLayout="Flow">
<asp:ListItem Value="true">启用</asp:ListItem>
<asp:ListItem Value="false">禁用</asp:ListItem>
</asp:RadioButtonList></td>
<td align="right" class="forumRowHighlight">
马赛克范围</td>
<td class="forumRowHighlight">
X<asp:TextBox ID="txtmX" runat="server" Height="20px" MaxLength="3" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px"></asp:TextBox>
Y<asp:TextBox ID="txtmY" runat="server" Height="20px" MaxLength="3" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px"></asp:TextBox>
width<asp:TextBox ID="txtmWidth" runat="server" Height="20px" MaxLength="3" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px"></asp:TextBox>
height<asp:TextBox ID="txtmHeight" runat="server" Height="20px" MaxLength="3" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px"></asp:TextBox></td>
</tr>
<tr>
<td align="right" style="width: 20%">
图片裁剪</td>
<td align="right" style="width: 330px; text-align: left">
<asp:RadioButtonList ID="Cut" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
RepeatLayout="Flow">
<asp:ListItem Value="true">启用</asp:ListItem>
<asp:ListItem Value="false">禁用</asp:ListItem>
</asp:RadioButtonList></td>
<td align="right">
裁剪范围</td>
<td >
X<asp:TextBox ID="txtcX" runat="server" Height="20px" MaxLength="3" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px"></asp:TextBox>
Y<asp:TextBox ID="txtcY" runat="server" Height="20px" MaxLength="3" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px"></asp:TextBox>
width<asp:TextBox ID="txtcWidth" runat="server" Height="20px" MaxLength="3" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px"></asp:TextBox>
height<asp:TextBox ID="txtcHeight" runat="server" Height="20px" MaxLength="3" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px"></asp:TextBox></td>
</tr>
<tr>
<td align="right" class="forumRowHighlight" style="width: 20%">
是否生成缩略图</td>
<td align="right" class="forumRowHighlight" style="width: 330px; text-align: left"><asp:RadioButtonList ID="Miniature" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
RepeatLayout="Flow">
<asp:ListItem Value="true">启用</asp:ListItem>
<asp:ListItem Value="false">禁用</asp:ListItem>
</asp:RadioButtonList></td>
<td align="right" class="forumRowHighlight">
删除原图</td>
<td class="forumRowHighlight"><asp:RadioButtonList ID="DelPic" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
RepeatLayout="Flow">
<asp:ListItem Value="true">是</asp:ListItem>
<asp:ListItem Value="false">否</asp:ListItem>
</asp:RadioButtonList></td>
</tr>
<tr>
<td align="right" style="width: 20%">
旋转角度</td>
<td align="right" style="text-align: left; width: 330px;">
<asp:TextBox ID="tb_Angle" runat="server" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px" MaxLength="3" Height="20px"></asp:TextBox>度</td>
<td align="right">
自定义缩略图路径</td>
<td>
<asp:TextBox ID="tb_MinPath" runat="server" Width="170px"></asp:TextBox>
说明:相对路径</td>
</tr>
<tr>
<td align="right" class="forumRowHighlight" style="width: 20%">
水印字体</td>
<td align="right" class="forumRowHighlight" style="text-align: left; width: 330px;">
<asp:DropDownList ID="ddl_font" runat="server">
</asp:DropDownList></td>
<td align="right" class="forumRowHighlight">
自定义生成水印图片宽度</td>
<td class="forumRowHighlight">
<asp:TextBox ID="tb_ZipWidth" runat="server" Width="45px"></asp:TextBox>像素</td>
</tr>
<tr>
<td align="right" style="width: 20%">
文字大小</td>
<td align="right" style="text-align: left; width: 330px;">
<asp:TextBox ID="tb_FontSize" runat="server" onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
Width="35px" MaxLength="3" Height="20px"></asp:TextBox>号</td>
<td align="right">
自定义生成水印图片高度</td>
<td>
<asp:TextBox ID="tb_ZipHeight" runat="server" Width="45px" ></asp:TextBox>像素</td>
</tr>
<tr>
<td align="right" class="forumRowHighlight" style="width: 20%">
文字颜色</td>
<td align="right" class="forumRowHighlight" style="text-align: left; width: 330px;">
<asp:TextBox ID="tb_FontColor" runat="server" MaxLength="7" Style="cursor:default" Width="35px"></asp:TextBox>
<img id="Img2" src="Images/color1.gif" border="0" title="选择颜色" onmouseover="src='Images/color2.gif'" onmouseout="src='Images/color1.gif'" Style="cursor: default; position: absolute;" onClick='SelectColor(this,tb_FontColor)' /></td>
<td align="right" class="forumRowHighlight">
自定义生成水印图片路径</td>
<td class="forumRowHighlight">
<asp:TextBox ID="tb_SavePath" runat="server" Width="170px"></asp:TextBox>
说明:相对路径</td>
</tr>
<tr>
<td align="right" style="width: 7841px">
文字形状</td>
<td align="right" style="text-align: left; width: 330px;">
<asp:DropDownList ID="ddl_Form" runat="server">
</asp:DropDownList></td>
<td align="right">
设置生成水印图片后的效果</td>
<td style="font-weight: bold">
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="None">未配置</asp:ListItem>
<asp:ListItem Value="Monochrome">黑白</asp:ListItem>
<asp:ListItem Value="Negative">负片</asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td align="right" class="forumRowHighlight" style="width: 20%">
阴影颜色</td>
<td align="right" class="forumRowHighlight" style="text-align: left; width: 330px;">
<asp:TextBox ID="tb_FontShadow" runat="server" MaxLength="7" Style="cursor: default" Width="35px"></asp:TextBox>
<img id="Img1" src="Images/color1.gif" border="0" title="选择颜色" onmouseover="src='Images/color2.gif'" onmouseout="src='Images/color1.gif'" Style="cursor: default; position: absolute;" onClick='SelectColor(this,tb_FontShadow)' /></td>
<td align="right" class="forumRowHighlight">
去水印图片底色</td>
<td class="forumRowHighlight">
<asp:TextBox ID="tb_groundcolor" runat="server" MaxLength="7" Style="cursor: default" Width="35px" Height="22px"></asp:TextBox>
<img id="selectcolor" src="Images/color1.gif" border="0" title="选择颜色" onmouseover="src='Images/color2.gif'" onmouseout="src='Images/color1.gif'" Style="cursor: default; position: absolute;" onClick='SelectColor(this,tb_groundcolor)' /></td>
</tr>
<tr align="center" class="tablefoot">
<td colspan="4" height="25">
<asp:Button ID="But_Save" runat="server" Text="保存设置" OnClick="But_Save_Click1" Height="25px" /></td>
</tr>
</table>
<span style="font-size: 14pt"></span>
</form>
</body>
</html>

