温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:ASP.NET 2.53 缩略图水印组件源码
当前文件:
ImageWaterMark253/Config_XML.aspx.cs,打开代码结构图
ImageWaterMark253/Config_XML.aspx.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using System.IO; 12
using System.Text; 13
using ImageWaterMark; 14
15
namespace ImageWaterMark 16
{ 17
public partial class XML : XMLX 18
{ 19
XMLX bind = new XMLX(); 20
protected void Page_Load(object sender, EventArgs e) 21
{ 22
23
if (!IsPostBack) 24
{ 25
colorloading(); 26
string[] FormValue = new string[] { "None","Bold", "Underline", "Italic", "Strikeout" }; 27
string[] FormName = new string[] { "禁用文本样式","加粗文本", "下划线文本", "倾斜文本", "中划线文本" }; 28
for (int i = 0; i < FormValue.Length; i++) 29
{ 30
ddl_Form.Items.Add(new ListItem(FormName[i].ToString(), FormValue[i].ToString())); 31
32
} 33
bind.getcolor(ref ddl_font); 34
rb_NoAndOff.SelectedValue = bind.XMLRead("NoAndOff"); 35
rb_PicAndText.SelectedValue = bind.XMLRead("PicAndText"); 36
tb_picpath.Text = bind.XMLRead("PicPath"); 37
tb_WM_Text.Text = bind.XMLRead("WM_Text"); 38
ddl_Location.SelectedValue = bind.XMLRead("WM_Location"); 39
tb_Transparence.Text = bind.XMLRead("WM_Transparence"); 40
tb_Angle.Text = bind.XMLRead("WM_Angle"); 41
ddl_font.SelectedValue = bind.XMLRead("Font"); 42
tb_FontSize.Text = bind.XMLRead("FontSize"); 43
tb_FontColor.Text = bind.XMLRead("FontColor"); 44
tb_FontShadow.Text = bind.XMLRead("FontShadow"); 45
ddl_Form.SelectedValue = bind.XMLRead("FontForm"); 46
tb_groundcolor.Text = XMLRead("Grounding"); 47
tb_PlaceX.Text = XMLRead("PlaceX"); 48
tb_PlaceY.Text = XMLRead("PlaceY"); 49
tb_ShadowX.Text = XMLRead("ShadowX"); 50
tb_ShadowY.Text = XMLRead("ShadowY"); 51
tb_ZipWidth.Text = XMLRead("ZipWidth"); 52
tb_ZipHeight.Text = XMLRead("ZipHeight"); 53
tb_MinWidth.Text = XMLRead("MinWidth"); 54
tb_MinHeight.Text = XMLRead("MinHeight"); 55
tb_MinPath.Text = XMLRead("MinPath"); 56
tb_SavePath.Text = XMLRead("SavePath"); 57
DropDownList1.SelectedValue = XMLRead("Effect"); 58
Txtshadowtransparence.Text = XMLRead("Txtshadowtransparence"); 59
PicVal.Text = XMLRead("PicVal"); 60
Mosaic.SelectedValue = XMLRead("Mosaic"); 61
tb_Granule.Text = XMLRead("Granule"); 62
txtmX.Text = XMLRead("txtmX"); 63
txtmY.Text = XMLRead("txtmY"); 64
txtmWidth.Text = XMLRead("txtmWidth"); 65
txtmHeight.Text = XMLRead("txtmHeight"); 66
Cut.SelectedValue = XMLRead("Cut"); 67
txtcX.Text = XMLRead("txtcX"); 68
txtcY.Text = XMLRead("txtcY"); 69
txtcWidth.Text = XMLRead("txtcWidth"); 70
txtcHeight.Text = XMLRead("txtcHeight"); 71
Miniature.SelectedValue = XMLRead("Miniature"); 72
tb_Brightness.Text = XMLRead("Brightness"); 73
tb_Contrast.Text = XMLRead("Contrast"); 74
tb_RGBValue1.Text = XMLRead("RGBValueR"); 75
tb_RGBValue2.Text = XMLRead("RGBValueG"); 76
tb_RGBValue3.Text = XMLRead("RGBValueB"); 77
ImgXY.SelectedValue = XMLRead("imgXY"); 78
Rb_freely.SelectedValue = XMLRead("freely"); 79
Rb_del.SelectedValue = XMLRead("imgdel"); 80
Rb_show.SelectedValue = XMLRead("txtshowoff"); 81
82
} 83
} 84
85
protected void But_Save_Click1(object sender, EventArgs e) 86
{ 87
try 88
{ 89
if (Convert.ToInt32(tb_Transparence.Text) > 100) 90
Alert("透明度不支持大于100,请重设!"); 91
else 92
bind.CreateXML(rb_NoAndOff.SelectedValue, rb_PicAndText.SelectedValue, 93
tb_picpath.Text, tb_WM_Text.Text, ddl_Location.SelectedValue, tb_Transparence.Text, 94
tb_Angle.Text, ddl_font.SelectedValue, tb_FontSize.Text, tb_FontColor.Text, tb_FontShadow.Text, 95
ddl_Form.SelectedValue, tb_groundcolor.Text, tb_ShadowX.Text, tb_ShadowY.Text, 96
tb_PlaceX.Text, tb_PlaceY.Text, tb_MinWidth.Text, tb_MinHeight.Text, tb_ZipWidth.Text, 97
tb_ZipHeight.Text, tb_MinPath.Text, tb_SavePath.Text, DropDownList1.SelectedValue, 98
Txtshadowtransparence.Text,PicVal.Text,Mosaic.SelectedValue,tb_Granule.Text, 99
txtmX.Text,txtmY.Text,txtmWidth.Text,txtmHeight.Text,Cut.SelectedValue, 100
txtcX.Text,txtcY.Text,txtcWidth.Text,txtcHeight.Text,Miniature.SelectedValue, 101
tb_Brightness.Text,tb_Contrast.Text,tb_RGBValue1.Text,tb_RGBValue2.Text,tb_RGBValue3.Text, 102
ImgXY.SelectedValue,Rb_freely.SelectedValue,Rb_del.SelectedValue,Rb_show.SelectedValue); 103
104
colorloading(); 105
Alert("保存成功!"); 106
} 107
catch 108
{ 109
Alert("保存失败!"); 110
} 111
112
113
} 114
private void colorloading() 115
{ 116
tb_groundcolor.BackColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("Grounding")); 117
tb_groundcolor.ForeColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("Grounding")); 118
tb_FontColor.BackColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("FontColor")); 119
tb_FontColor.ForeColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("FontColor")); 120
tb_FontShadow.BackColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("FontShadow")); 121
tb_FontShadow.ForeColor = System.Drawing.ColorTranslator.FromHtml(XMLRead("FontShadow")); 122
} 123
124
125
} 126
}





}
}