Examples/ePicture.aspx.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EKETEAM.FrameWork;

namespace eFrameWork.Examples
{
    public partial class _ePicture : System.Web.UI.Page
    {
        private eAction action;
        protected void Page_Load(object sender, EventArgs e)
        {
            action = new eAction();
            action.Actioning += action_Actioning;
            action.Listen();
        }
        protected void action_Actioning(string Action)
        {
            string source = "";
            string dest;
            switch (Action)
            {
                case "step1":
                    source = Server.MapPath("images/pic.bmp");
                    dest = Server.MapPath("images/pic_1.bmp");
                    if (System.IO.File.Exists(dest)) System.IO.File.Delete(dest);//如果有,则删除之前生成的文件。
                    System.IO.File.Copy(source, dest);//复制文件来操作,否则源文件将被替换。
                    //ePicture.SaveToJPG(dest, 100);//指定图片品质为:100,默认为80
                    ePicture.SaveToJPG(dest);
                    litBody.Text = "操作成功!<br>路径为:" + Server.MapPath("images/pic_1.jpg");
                    break;
                case "step2":
                    source = Server.MapPath("images/pic.jpg");
                    dest = Server.MapPath("images/pic_2.jpg");
                    if (System.IO.File.Exists(dest)) System.IO.File.Delete(dest);//如果有,则删除之前生成的文件。
                    System.IO.File.Copy(source, dest);//复制文件来操作,否则源文件将被替换
                    ePicture.ToWidth(dest, 800);
                    litBody.Text = "操作成功!<br>路径为:" + dest;
                    break;
                case "step3":
                    source = Server.MapPath("images/pic.jpg");
                    dest = Server.MapPath("images/pic_3.jpg");
                    if (System.IO.File.Exists(dest)) System.IO.File.Delete(dest);//如果有,则删除之前生成的文件。
                    System.IO.File.Copy(source, dest);//复制文件来操作,否则源文件将被替换
                    ePicture.ToHeight(dest, 800);
                    litBody.Text = "操作成功!<br>路径为:" + dest;
                    break;
                case "step4":
                    source = Server.MapPath("images/pic.jpg");
                    dest = Server.MapPath("images/pic_4.jpg");
                    if (System.IO.File.Exists(dest)) System.IO.File.Delete(dest);//如果有,则删除之前生成的文件。
                    System.IO.File.Copy(source, dest);//复制文件来操作,否则源文件将被替换
                    ePicture.ToSize(dest, 800, 600);
                    litBody.Text = "操作成功!<br>路径为:" + dest;
                    break;
                case "step5":
                    source = Server.MapPath("images/pic.jpg");
                    dest = Server.MapPath("images/pic_5.jpg");
后面还有 26 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。