国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

圖片簡單處理

2019-11-17 01:58:19
字體:
來源:轉載
供稿:網友

圖片簡單處理

前臺

<%@ 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></head><body>    <form id="form1" runat="server">    <div>        <asp:Image ID="IMG1" runat="server" ImageUrl="~/App_Themes/Image/0.jpg" />        <asp:Image ID="IMG2" runat="server" />        <asp:Image ID="IMG3" runat="server" />        <asp:Image ID="IMG4" runat="server" />        <br />                <asp:Button ID="Btn_SuoFang" runat="server" Text="縮放" OnClick="Click_Btn_SuoFang" />        <asp:Button ID="Btn_ZiCai" runat="server" Text="自定義縮放" OnClick="Click_Btn_ZiCai" />        <asp:Button ID="Btn_ShuiYing" runat="server" Text="水印" OnClick="Click_Btn_ShuiYing" />    </div>    </form></body></html>

后臺

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>    /// 縮放圖片    /// </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>    /// 自定義截圖縮放    /// </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>    /// 水印    /// </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";    }}

簡單的處理一下圖片算是一點小積累~

123


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 盐亭县| 宜宾县| 托克逊县| 庆元县| 郯城县| 儋州市| 西畴县| 疏勒县| 光泽县| 长治市| 双城市| 湖南省| 石渠县| 铁岭市| 临江市| 海伦市| 赤峰市| 夏河县| 通江县| 成武县| 乌海市| 新津县| 上杭县| 德保县| 康定县| 巴彦淖尔市| 定日县| 永新县| 若尔盖县| 夹江县| 竹溪县| 营口市| 万盛区| 泽库县| 云浮市| 丰县| 德江县| 高陵县| 吴桥县| 夏邑县| 博野县|