Exemplo n.º 1
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;
     }
 }
Exemplo n.º 2
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;
     }
 }
Exemplo n.º 3
0
 public static bool IsQueryString(string strQuery)
 {
     return(PicRar.IsQueryString(strQuery, "N"));
 }