六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

asp+文件上傳增強案例

[摘要]按實際上傳時的文件名稱保存(不在是test.jpg了)圖片可以改大小,圖上寫字(可選字體,我設的全是中文,^_^。大�。�,沒有解決字體顏色問題。 <%@ Page Language="...
按實際上傳時的文件名稱保存(不在是test.jpg了)圖片可以改大小,圖上寫字(可選字體,我設的全是中文,^_^。大
小),沒有解決字體顏色問題。

<%@ Page Language="c#" Debug="true" Trace="true"%>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<html>
<script runat =server>
void UploadBtn_Click(Object sender, EventArgs e) {
String filename;
String filename1;
String[] filename2;
int q;
filename=UploadFile.PostedFile.FileName ;
filename2=filename.Split(new Char[] {'\\'});
q=filename2.GetUpperBound(0);
filename1=filename2[q];
dis.Text="上傳文件名:"+filename1+"<br>";
UploadFile.PostedFile.SaveAs(Server.MapPath(filename1));
ImageEditor.Visible = true;
dis.Text+="文件大小:"+UploadFile.PostedFile.ContentLength+"字節數";
Image1.Src=filename1;
}
void UpdateBtn_Click(Object sender, EventArgs e) {
String filename1;
filename1=Image1.Src;
System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath(filename1));
System.Drawing.Image newimage = new Bitmap(image.Width, image.Height, PixelFormat.Format32bppRGB);
Graphics g = Graphics.FromImage(newimage);
g.DrawImage(image,0,0,image.Width,image.Height);
Font f = new Font(FontType.SelectedItem.Text, Int32.Parse(FontSize.SelectedItem.Text));
Brush b = new SolidBrush(Color.Red);
g.DrawString(Caption.Text, f, b, 10, 140);
g.Dispose();
System.Drawing.Image thumbImage = newimage.GetThumbnailImage(Int32.Parse(Width.Text),Int32.Parse
(Height.Text),null,0);
image.Dispose();
thumbImage.Save(Server.MapPath(filename1), ImageFormat.JPEG);
Image1.Src=filename1;
Caption.Text="";

}

</script>

<body>
<asp:label id="dis" runat=server/>
<form enctype="multipart/form-data" runat=server>

<h3>

Select File To Upload: <input id="UploadFile" type=file runat=server>

<asp:button Text="Upload Me!" OnClick="UploadBtn_Click" runat=server/>

<hr>

<asp:panel id="ImageEditor" Visible=false runat=server>

<img ID="Image1" src="" runat="server"/>

<h3>
Image Width: <asp:textbox id="Width" runat=server/>

Image Height: <asp:textbox id="Height" runat=server/> <br>

Text Caption: <asp:textbox id="Caption" runat=server/>

Caption Size: <asp:dropdownlist id="FontSize" runat=server>
<asp:listitem>14</asp:listitem>
<asp:listitem>18</asp:listitem>
<asp:listitem>26</asp:listitem>
<asp:listitem>36</asp:listitem>
<asp:listitem>48</asp:listitem>
<asp:listitem>62</asp:listitem>
</asp:dropdownlist>
Caption Font: <asp:dropdownlist id="FontType" runat=server>
<asp:listitem>黑體</asp:listitem>
<asp:listitem>仿宋</asp:listitem>
<asp:listitem>隸書</asp:listitem>
<asp:listitem>楷書</asp:listitem>
<asp:listitem>方正姚體</asp:listitem>
<asp:listitem>華文彩云</asp:listitem>
</asp:dropdownlist>

<asp:button Text="Update Image" OnClick="UpdateBtn_Click" runat=server/>

</h3>
</asp:panel>

</form>

</body>
</html>





主站蜘蛛池模板: 人人舔人人爱 | 天天久久| 日韩综合久久 | 人人狠 | 午夜视频福利在线 | 欧美亚洲三级 | 日韩三级免费 | 亚洲αv| 天天噜天天噜噜在线视频 | 亚洲专区路线一路线二 | 日本亚洲欧美国产ay | 日产乱码卡一卡2卡三卡四福利 | 亚洲 欧美 日韩 综合 | 亚洲精品乱码久久久久久 | 亚洲 日本 欧美 | 亚洲日韩中文字幕在线播放 | 午夜黄大色黄大片美女图片 | 在线观看国产日本 | 天天干中文字幕 | 亚洲欧洲国产精品你懂的 | 天天摸夜夜操 | 最新国产中文字幕 | 日本黄在线观看 | 欧美一级看片免费观看视频在线 | 亚洲免费视频在线观看 | 午夜在线精品不卡国产 | 天堂18 | 欧美视频导航| 色www免费视频| 日韩精品欧美国产精品忘忧草 | 最新午夜 | 青娱乐免费视频在线观看 | 亚洲福利 影院 | 五月婷婷影院 | 深夜国产福利 | 亚洲成人资源 | 泰剧不期而爱第三季免费全集观看 | 四虎永久精品免费观看 | 婷婷六月丁香色婷婷网 | 亚洲精品天堂在线观看 | 亚洲1页|