FLASH論壇-Flash之神魂顛倒Adobe Flash 大家園RIA整合討論版 → FLASH產生圖像的範例

MSDN 研討會資料下載 熱門租屋行情 網路行銷秘訣大公開 磷蝦油=比魚油更強 Microsoft Silverlight
墨水匣、碳粉匣 - 天天都便宜 888Boss 創業加盟網 碳粉匣、墨水匣 - 天天都特價 減肥診所 雷射抽脂
ASP.NET完全攻略與快速上手 買墨水送神幣喔 抽脂 近視雷射手術 電波拉皮
網路創業 SEO 借錢 投影機 公仔
植牙 貸款 白蟻 氣球 眼袋
虛擬主機神魂特惠 大陸新娘 NCCU集中營 網頁設計 愛情城市
微軟MIX08 Taipei 落健 液晶電視

  共有2097人閱讀過本文章折疊列印

主題:FLASH產生圖像的範例

帥哥喲,離線,有人找我嗎?
TWG
  1樓 個人化首頁 | QQ | 個人資料 | 搜尋 | EMAIL | 首頁 | |

加到: FunP 書籤加到: 黑米書籤加到: MyShare 書籤加到: 美味書籤加到: Furl  書籤加到: YaHoo 分享書籤加到: Google 書籤加到: UDN 書籤加到: Technorati 書籤



加好友 悄悄話 •神•魂•顛•倒•
等級:管理員 文章:2110 經驗:20826 威望:7 精華:7 註冊:2002-4-12 15:57:00
  發表心情 Post By:2006-10-8 1:20:00



FLASH產生圖像的範例

範例 http://www.lzlive.com/outjpg/




<%@ Page Language="C#" AutoEventWireup="true" CodeFile="send.aspx.cs" Inherits="send2" %>

<!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>無標題頁</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>



=========================================.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Drawing.Imaging;
using System.Text;
using System.IO;

public partial class send2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Request.SaveAs(Page.MapPath("./") + "/text.txt", true);
// isConn.HostCheckCookies(false, true, "Login.aspx?Url=" + Request.RawUrl.ToString(), null);
if (!Page.IsPostBack)
{
// int Mid = int.Parse(isConn.GetHostCookiesItem("v1").ToString());
string View = (Request.QueryString["View"] != null) ? Request.QueryString["View"].ToString() : null;
if (View == null)
{
// SetImg(Mid);
}
else if (View.Equals("Com"))
{
int w = int.Parse(Request.Form["width"].ToString());
int h = int.Parse(Request.Form["height"].ToString());

string[] pixelColor = new string[h];
for (int i = 0; i < h; i++)
{
pixelColor[i] = Request.Form["PX" + i].ToString();
}
SaveJpg(w, h, pixelColor);
}

}
}

protected void SaveJpg(int width, int height, string[] pixelColor)
{
Bitmap image = new Bitmap(width, height);
string delimStr = ",";
char[] delimiter = delimStr.ToCharArray();
for (int i = 0; i < height; i++)
{
string[] colDot = pixelColor[i].ToString().Split(delimiter);
for (int j = 0; j < colDot.Length; j++)
{
int rgb = Convert.ToInt32(colDot[j].ToString());
image.SetPixel(j, i, Color.FromArgb(rgb));
}
}
string text2 = DateTime.Now.ToString("yyyyMMddhhmmss") + ".jpg";
string SavePath = base.Server.MapPath("./") + text2;
image.Save(SavePath, ImageFormat.Jpeg);
Response.ContentType = "image/jpeg";
image.Save(Response.OutputStream, ImageFormat.Jpeg);
image.Dispose();
}
}
[Edit on 2006-7-9 13:15:46 By tansenen]


來源:
http://www.lzlive.net/riji/showlog.asp?cat_id=44&log_id=643


網路的事情,讓網路解決

[ 逛網路就像是在探險 ]

    神 魂 顛 倒 T W G

http://bbs.flash2u.com.tw

http://tw.myblog.yahoo.com/flash2u-twg

http://flash-silverlight.blogspot.com/

http://flash2u.spaces.live.com/?_c02_owner=1
植牙 支持(0中立(0反對(0回到頂部