zoukankan      html  css  js  c++  java
  • 象yhoo相册那样在网页上操作图片(不完全)_2

    操作页面后面代码

    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)
            
    {
                
    亮度减少
            }



  • 相关阅读:
    升级windows 11小工具
    windows 10更新升级方法
    您需要了解的有关 Oracle 数据库修补的所有信息
    Step by Step Apply Rolling PSU Patch In Oracle Database 12c RAC Environment
    Upgrade Oracle Database Manually from 12.2.0.1 to 19c
    如何应用版本更新 12.2.0.1.210420(补丁 32507738 – 2021 年 4 月 RU)
    xtrabackup 安装、备份和恢复
    Centos_Lvm expand capacity without restarting CentOS
    Centos_Lvm_Create pv vg lv and mount
    通过全备+relaylog同步恢复被drop的库或表
  • 原文地址:https://www.cnblogs.com/cerxp/p/80870.html
Copyright © 2011-2022 走看看