Simple image processing and image processing

Source: Internet
Author: User

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 ~

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.