這個想法是小弟在讀書時期..教授用來追女朋友的idea....分享給大家呀...
如果是常常在家寫程式的人..沒時間陪女朋友....就做一個送女朋友呀...
在此要感謝提供美美測試照片的朋友..eVonne...
這個想法是小弟在讀書時期..教授用來追女朋友的idea....分享給大家呀...
如果是常常在家寫程式的人..沒時間陪女朋友....就做一個送女朋友呀...
在此要感謝提供美美測試照片的朋友..eVonne...
聽說越遠看越清楚喔...
eVonneImageProcess.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="eVonneImageProcess.aspx.cs" Inherits="eVonneImageProcess" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>eVonneImageProcess</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Selected="True" Value="灰階">灰階</asp:ListItem>
<asp:ListItem Value="彩色">彩色</asp:ListItem>
</asp:RadioButtonList><asp:TextBox ID="TextBox1" runat="server">eVonne </asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="執行" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
ErrorMessage="字串不可以為空"></asp:RequiredFieldValidator><br />
<asp:Image ID="Image1" runat="server" ImageUrl="~/evonne.jpg" /><br />
<asp:Literal ID="Literal1" runat="server"></asp:Literal></div>
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>eVonneImageProcess</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Selected="True" Value="灰階">灰階</asp:ListItem>
<asp:ListItem Value="彩色">彩色</asp:ListItem>
</asp:RadioButtonList><asp:TextBox ID="TextBox1" runat="server">eVonne </asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="執行" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
ErrorMessage="字串不可以為空"></asp:RequiredFieldValidator><br />
<asp:Image ID="Image1" runat="server" ImageUrl="~/evonne.jpg" /><br />
<asp:Literal ID="Literal1" runat="server"></asp:Literal></div>
</form>
</body>
</html>
eVonneImageProcess.aspx.cs




















protected void Button1_Click(object sender, EventArgs e)



//載入你要處理的圖片


int cnt = 0;

sb.Append("<pre>");

//x=x+2,如果產生的圖片太高可以調整這個,可以+1,+2,+3





Color pixel = b.GetPixel(y, x);

//顯示的格式可以自行調整














this.Literal1.Text = sb.ToString();






return str[cnt % str.Length].ToString();


protected Color ToGray(Color pixel)



return Color.FromArgb(val, val, val);


執行結果:
原始程式碼下載:evonne.rar