예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string virtualPath = string.Empty;
         int maxWidth = 0;
         int maxHeight = 0;
         if (IsQueryString("P", "S"))
         {
             virtualPath = Request.QueryString["P"];
         }
         if (IsQueryString("W"))
         {
             maxWidth = int.Parse(Request.QueryString["W"]);
         }
         if (IsQueryString("H"))
         {
             maxHeight = int.Parse(Request.QueryString["H"]);
         }
         if (virtualPath != string.Empty)
         {
             PIC pic = new PIC();
             if (!virtualPath.StartsWith("/"))
             {
                 virtualPath = "/" + virtualPath;
             }
             virtualPath = Globals.ApplicationPath + virtualPath;
             pic.SendSmallImage(Request.MapPath(virtualPath), maxHeight, maxWidth);
             string watermarkFilename = Request.MapPath(Globals.ApplicationPath + "/Admin/images/watermark.gif");
             MemoryStream stream = pic.AddImageSignPic(pic.OutBMP, watermarkFilename, 9, 60, 4);
             pic.Dispose();
             Response.ClearContent();
             Response.ContentType = "image/gif";
             Response.BinaryWrite(stream.ToArray());
             Response.End();
             stream.Dispose();
         }
     }
     catch (Exception exception)
     {
         label_html = exception.Message;
     }
 }
예제 #2
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     try
     {
         string virtualPath = string.Empty;
         int    maxWidth    = 0;
         int    maxHeight   = 0;
         if (PicRar.IsQueryString("P", "S"))
         {
             virtualPath = base.Request.QueryString["P"];
         }
         if (PicRar.IsQueryString("W"))
         {
             maxWidth = int.Parse(base.Request.QueryString["W"]);
         }
         if (PicRar.IsQueryString("H"))
         {
             maxHeight = int.Parse(base.Request.QueryString["H"]);
         }
         if (virtualPath != string.Empty)
         {
             PIC pic = new PIC();
             if (!virtualPath.StartsWith("/"))
             {
                 virtualPath = "/" + virtualPath;
             }
             virtualPath = Globals.ApplicationPath + virtualPath;
             pic.SendSmallImage(base.Request.MapPath(virtualPath), maxHeight, maxWidth);
             string watermarkFilename      = base.Request.MapPath(Globals.ApplicationPath + "/Admin/images/watermark.gif");
             System.IO.MemoryStream stream = pic.AddImageSignPic(pic.OutBMP, watermarkFilename, 9, 60, 4);
             pic.Dispose();
             base.Response.ClearContent();
             base.Response.ContentType = "image/gif";
             base.Response.BinaryWrite(stream.ToArray());
             base.Response.End();
             stream.Dispose();
         }
     }
     catch (System.Exception exception)
     {
         this.label_html = exception.Message;
     }
 }
예제 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string text      = string.Empty;
         int    maxWidth  = 0;
         int    maxHeight = 0;
         if (PicRar.IsQueryString("P", "S"))
         {
             text = base.Request.QueryString["P"];
         }
         if (PicRar.IsQueryString("W"))
         {
             maxWidth = int.Parse(base.Request.QueryString["W"]);
         }
         if (PicRar.IsQueryString("H"))
         {
             maxHeight = int.Parse(base.Request.QueryString["H"]);
         }
         if (!(text == string.Empty))
         {
             PIC pIC = new PIC();
             if (!text.StartsWith("/"))
             {
                 text = "/" + text;
             }
             text = text;
             pIC.SendSmallImage(base.Request.MapPath(text), maxHeight, maxWidth);
             string       watermarkFilename = base.Request.MapPath("/Admin/images/watermark.gif");
             MemoryStream memoryStream      = pIC.AddImageSignPic(pIC.OutBMP, watermarkFilename, 9, 60, 4);
             pIC.Dispose();
             base.Response.ClearContent();
             base.Response.ContentType = "image/gif";
             base.Response.BinaryWrite(memoryStream.ToArray());
             base.Response.End();
             memoryStream.Dispose();
         }
     }
     catch (Exception ex)
     {
         this.label_html = ex.Message;
     }
 }