protected System.Web.UI.WebControls.Image MyImage;
//private System.Drawing.Image ResultImg = null;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!Page.IsPostBack)
{
urlStr.Value="fileName=3_21165.jpg";
ChangImag();
}
}
private void Button1_Click(object sender, System.EventArgs e)
{
string strFilename=string.Empty;
System.Drawing.Image i;
strFilename = Server.MapPath("img/3_21165.jpg");
i = System.Drawing.Image.FromFile(strFilename);
System.Drawing.Bitmap b =new System.Drawing.Bitmap(500,600);
Graphics g = System.Drawing.Graphics.FromImage(b);
//'切割图片
g.DrawImage(i,new Rectangle(0,0,b.Width,b.Height),200,20,b.Width,b.Height,GraphicsUnit.Pixel);
Response.ContentType="image/jpeg";
b.Save(Server.MapPath("img/1.jpg"),System.Drawing.Imaging.ImageFormat.Jpeg);
b.Dispose();
Response.Write("<script language='javascript'>alert('OK');</script>");
}
private void TurnOne_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
//翻转
urlStr.Value=goUrl;
ChangImag();
}
private void ChangImag()
{
MyImage.ImageUrl="MyImg.aspx?"+urlStr.Value;
}
private void GoRr_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
//顺时钟
urlStr.Value=goUrl;
ChangImag();
}
private void GoRl_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
//逆时钟
urlStr.Value=goUrl;
ChangImag();
}
private void ContCut_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
对比减小
}
private void ContAdd_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
对比增加
}
private void BrightAdd_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
亮度增加
}
private void BrightCut_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
亮度减少
}
//private System.Drawing.Image ResultImg = null;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!Page.IsPostBack)
{
urlStr.Value="fileName=3_21165.jpg";
ChangImag();
}
}
private void Button1_Click(object sender, System.EventArgs e)
{
string strFilename=string.Empty;
System.Drawing.Image i;
strFilename = Server.MapPath("img/3_21165.jpg");
i = System.Drawing.Image.FromFile(strFilename);
System.Drawing.Bitmap b =new System.Drawing.Bitmap(500,600);
Graphics g = System.Drawing.Graphics.FromImage(b);
//'切割图片
g.DrawImage(i,new Rectangle(0,0,b.Width,b.Height),200,20,b.Width,b.Height,GraphicsUnit.Pixel);
Response.ContentType="image/jpeg";
b.Save(Server.MapPath("img/1.jpg"),System.Drawing.Imaging.ImageFormat.Jpeg);
b.Dispose();
Response.Write("<script language='javascript'>alert('OK');</script>");
}
private void TurnOne_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
//翻转
urlStr.Value=goUrl;
ChangImag();
}
private void ChangImag()
{
MyImage.ImageUrl="MyImg.aspx?"+urlStr.Value;
}
private void GoRr_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
//顺时钟
urlStr.Value=goUrl;
ChangImag();
}
private void GoRl_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
//逆时钟
urlStr.Value=goUrl;
ChangImag();
}
private void ContCut_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
对比减小
}
private void ContAdd_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
对比增加
}
private void BrightAdd_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
亮度增加
}
private void BrightCut_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
亮度减少
}