コード例 #1
0
ファイル: A_LoadUserPhoto.cs プロジェクト: q446328246/Nechj
        protected void btn_Image_Click(object sender, EventArgs e)
        {
            int    imageWidth       = int.Parse(txt_width.Text);
            int    imageHeight      = int.Parse(txt_height.Text);
            int    pOrigStartPointY = int.Parse(txt_top.Text);
            int    pOrigStartPointX = int.Parse(txt_left.Text);
            int    pPartWidth       = int.Parse(txt_DropWidth.Text);
            int    pPartHeight      = int.Parse(txt_DropHeight.Text);
            string str = CutPhotoHelp.SaveCutPic(Page.Server.MapPath(ImageIcon.ImageUrl),
                                                 Page.Server.MapPath(string_1), 0, 0, pPartWidth, pPartHeight,
                                                 pOrigStartPointX, pOrigStartPointY, imageWidth, imageHeight);

            imgphoto.ImageUrl = string_1 + str;
            var    action = (ShopNum1_Member_Action)LogicFactory.CreateShopNum1_Member_Action();
            string path   = action.SearchByMemLoginID(base.MemLoginID).Rows[0]["Photo"].ToString();

            try
            {
                if (path != "")
                {
                    File.Delete(Page.Server.MapPath(path));
                }
            }
            catch
            {
            }
            finally
            {
                action.UpdatePhoto(base.MemLoginID, string_1 + str);
                File.Delete(Page.Server.MapPath(hid_imgValue.Value));
                Page.ClientScript.RegisterStartupScript(typeof(A_LoadUserPhoto), "setPic",
                                                        "<script type='text/javascript'>setPic('" +
                                                        imgphoto.ImageUrl + "');</script>");
            }
        }
コード例 #2
0
ファイル: cut.aspx.cs プロジェクト: lianghf2000/powerway
    protected void Button1_Click(object sender, EventArgs e)
    {
        int w = int.Parse(this.realWidth.Value);
        int h = int.Parse(this.realHeight.Value);
        int top = int.Parse(this.top.Value.Replace("px", "").Trim()) * -1;
        int left = int.Parse(this.left.Value.Replace("px", "").Trim()) * -1;

        //Response.Write("W:" + w.ToString());
        //Response.Write("H:" + h.ToString());
        //Response.Write("T:" + top.ToString());
        //Response.Write("L:" + left.ToString());
        string imgurl = Request.QueryString["path"];
        string savepath = Server.MapPath("~/uploads/CutSmall/");

        string file = CutPhotoHelp.SaveCutPic(Server.MapPath("../uploads/"+imgurl), savepath, 0, 0, needWidth, needHeight, left, top, w, h);
        //Response.Write("<br>"+file);
        this.script.Text = "<script>setImg('CutSmall/" + file + "')</script>";
        //Response.End();
    }