Simple image processing and image processing
<% @ Page Language = "C #" AutoEventWireup = "true" CodeFile = "Pictrue. aspx. cs" Inherits = "Make_Pictrue_Pictrue" %> <! 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> <style type =" text/css "> </style>
Background
Using System; using System. collections. generic; using System. linq; using System. web; using System. web. UI; using System. web. UI. webControls; public partial class Make_Pictrue_Pictrue: System. web. UI. page {protected void Page_Load (object sender, EventArgs e) {if (! IsPostBack) {}}/// <summary> /// scale the image /// </summary> /// <param name = "sender"> </param> // <param name = "e"> </param> protected void Click_Btn_SuoFang (object sender, eventArgs e) {Make_pictrue img = new Make_pictrue (); System. IO. fileStream fs = new System. IO. fileStream (Server. mapPath ("~ /App_Themes/Image/0.jpg"), System. IO. fileMode. open); byte [] buffer = new byte [fs. length]; fs. read (buffer, 0, buffer. length); string dirpath = Server. mapPath ("~ /App_Themes/Image/1.jpg"); img. CutForSquare (fs, dirpath, 100,100); fs. Close (); IMG3.ImageUrl = "~ /App_Themes/Image/1.jpg ";} /// <summary> /// custom scaling /// </summary> /// <param name = "sender"> </param> /// <param name = "e"> </param> protected void Click_Btn_ZiCai (object sender, eventArgs e) {Make_pictrue img = new Make_pictrue (); System. IO. fileStream fs = new System. IO. fileStream (Server. mapPath ("~ /App_Themes/Image/0.jpg"), System. IO. fileMode. open); byte [] buffer = new byte [fs. length]; fs. read (buffer, 0, buffer. length); string dirpath = Server. mapPath ("~ /App_Themes/Image/2.jpg"); img. CutForCustom (fs, dirpath, 300,300,100); fs. Close (); IMG2.ImageUrl = "~ /App_Themes/Image/2.jpg ";} /// <summary> /// watermark /// </summary> /// <param name = "sender"> </param> /// <param name =" e "> </param> protected void Click_Btn_ShuiYing (object sender, eventArgs e) {Make_pictrue img = new Make_pictrue (); System. IO. fileStream fs = new System. IO. fileStream (Server. mapPath ("~ /App_Themes/Image/0.jpg"), System. IO. fileMode. open); byte [] buffer = new byte [fs. length]; fs. read (buffer, 0, buffer. length); string dirpath = Server. mapPath ("~ /App_Themes/Image/3.jpg"); string Shuipath = Server. MapPath ("~ /App_Themes/Image/shuiyin.jpg "); img. ZoomAuto (fs, dirpath, 150,150," 123 ", Shuipath); fs. Close (); IMG4.ImageUrl = "~ /App_Themes/Image/3.jpg ";}}
Simple processing is a little bit of accumulation ~