资源简介
很好的在线拍照功能 很好的在线拍照功能 很好的在线拍照功能
代码片段和文件信息
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender EventArgs e)
{
if (Request.Form[“PHeight“] != null && Request.Form[“PWidth“] != null && Request.Form[“strBMP“] != null)
{
try
{
Response.Write(“PWidth:“ + Request.Form[“PWidth“].ToString() + “
“);
Response.Write(“PHeight:“ + Request.Form[“PHeight“].ToString() + “
“);
int height = int.Parse(Request.Form[“PHeight“].ToString());
int width = int.Parse(Request.Form[“PWidth“].ToString());
string strBmp = Request.Form[“strBMP“].ToString();
Response.Write(strBmp + “
“);
SaveBmp(BuildBitmap(width height strBmp));
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
}
public System.Drawing.Bitmap BuildBitmap(int width int height string strBmp)
{
System.Drawing.Bitmap tmpBmp = new Bitmap(width height System.Drawing.Imaging.PixelFormat.Format32bppRgb);
string[] StmpBmp = strBmp.Split(‘‘);
int pos = 0;
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
tmpBmp.SetPixel(x y Color.FromArgb(int.Parse(StmpBmp[pos] System.Globalization.Numberstyles.HexNumber)));
pos++;
}
}
return tmpBmp;
}
public void SaveBmp(System.Drawing.Bitmap bmp)
{
string FileName = Server.MapPath(“image“) + “\\“ + System.Guid.NewGuid().ToString() + “.bmp“;
bmp.Save(FileName System.Drawing.Imaging.ImageFormat.Bmp);
}
public string GetframeList()
{
string[] fileList = System.IO.Directory.GetFiles(Server.MapPath(“frames“));
string frameList = “\r\n“;
string fileName = string.Empty;
foreach (string item in fileList)
{
fileName = item.Substring(item.LastIndexOf(“\\“) + 1);
frameList += “\r\n“;
}
frameList += “ript language=\“javascript\“ type=\“text/javascript\“>InitMoveParm(document.getElementById(\“div_List\“)1100“ + (fileList.Length + 1).ToString() + “37550); ript>“;
return frameList;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2003-10-20 13:30 PhotoOnline\App_Data
文件 755 2008-10-07 15:53 PhotoOnline\CSS\myCss.css
目录 0 2003-10-20 13:30 PhotoOnline\CSS
文件 2639 2008-10-07 21:37 PhotoOnline\Default.aspx
文件 2986 2008-10-07 21:24 PhotoOnline\Default.aspx.cs
文件 1371 2008-09-27 09:20 PhotoOnline\fr
文件 1567 2008-09-26 14:21 PhotoOnline\fr
文件 1553 2008-09-27 09:18 PhotoOnline\fr
文件 1657 2008-09-27 09:19 PhotoOnline\fr
文件 1567 2008-09-26 14:21 PhotoOnline\fr
文件 1553 2008-09-27 09:18 PhotoOnline\fr
文件 1657 2008-09-27 09:19 PhotoOnline\fr
文件 1371 2008-09-27 09:20 PhotoOnline\fr
文件 1567 2008-09-26 14:21 PhotoOnline\fr
文件 1553 2008-09-27 09:18 PhotoOnline\fr
文件 1657 2008-09-27 09:19 PhotoOnline\fr
文件 1567 2008-09-26 14:21 PhotoOnline\fr
文件 1553 2008-09-27 09:18 PhotoOnline\fr
文件 1657 2008-09-27 09:19 PhotoOnline\fr
文件 1371 2008-09-27 09:20 PhotoOnline\fr
文件 1371 2008-09-27 09:20 PhotoOnline\fr
目录 0 2003-10-20 13:30 PhotoOnline\fr
文件 126054 2003-10-20 13:50 PhotoOnline\image\f92725ae-fdd0-4733-bab9-dd2f71c7d1ed.bmp
..A.SH. 18432 2008-10-20 11:46 PhotoOnline\image\Thumbs.db
目录 0 2003-10-20 13:50 PhotoOnline\image
文件 160 2008-10-05 21:57 PhotoOnline\Init.xm
文件 438 2008-10-07 20:44 PhotoOnline\JS\JsAndAs.js
文件 4400 2008-10-07 13:56 PhotoOnline\JS\JSPage.js
目录 0 2003-10-20 13:30 PhotoOnline\JS
文件 4002 2008-10-07 20:57 PhotoOnline\OnlinePhoto.htm
............此处省略12个文件信息
- 上一篇:C#的GDI+绘制图形分层拖放操作源码
- 下一篇:SQLite操作类C#
评论
共有 条评论