Example #1
0
        private void GetImage(HttpContext context)
        {
            string fullPath = context.Server.MapPath(imageCachePath);

            if (!fullPath.EndsWith(@"\"))
            {
                fullPath += @"\";
            }

            //Image img = (Image)SiteImage.GetSiteThumbnail(siteUrl, browserWidth, browserHeight, thumbnailWidth, thumbnailHeight, fullPath);
            SiteImage siteImage = new SiteImage(siteUrl, browserWidth, browserHeight, thumbnailWidth, thumbnailHeight, fullPath);

            //Image img = (Image)siteImage.GetScreenShot();

            Bitmap b = siteImage.GetScreenShot();

            if (b == null)
            {
                b = (Bitmap)System.Drawing.Image.FromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("mojoPortal.SiteImageService.Notavailable.jpg"));
            }

            Image img = (Image)b;

            context.Response.ContentType = "image/jpg";

            img.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
        }
Example #2
0
 public static Bitmap GetSiteThumbnail(string url, int width, int height, int thumbWidth, int thumbHeight)
 {
     SiteImage thumb = new SiteImage(url, width, height, thumbWidth, thumbHeight);
     Bitmap b = thumb.GetScreenShot();
     if (b == null)
         b = (Bitmap)System.Drawing.Image.FromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("mojoPortal.SiteImageService.Notavailable.jpg"));
     return b;
 }
Example #3
0
        public static Bitmap GetSiteThumbnail(string url, int width, int height, int thumbWidth, int thumbHeight, string absolutePath)
        {
            SiteImage thumb = new SiteImage(url, width, height, thumbWidth, thumbHeight, absolutePath);
            Bitmap    b     = thumb.GetScreenShot();

            if (b == null)
            {
                b = (Bitmap)System.Drawing.Image.FromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("mojoPortal.SiteImageService.Notavailable.jpg"));
            }
            return(b);
        }
Example #4
0
        private void GetImage(HttpContext context)
        {
            string fullPath = context.Server.MapPath(imageCachePath);

            if (!fullPath.EndsWith(@"\")) { fullPath += @"\"; }

            //Image img = (Image)SiteImage.GetSiteThumbnail(siteUrl, browserWidth, browserHeight, thumbnailWidth, thumbnailHeight, fullPath);
            SiteImage siteImage = new SiteImage(siteUrl, browserWidth, browserHeight, thumbnailWidth, thumbnailHeight, fullPath);

            //Image img = (Image)siteImage.GetScreenShot();

            Bitmap b = siteImage.GetScreenShot();
            if (b == null)
                b = (Bitmap)System.Drawing.Image.FromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("mojoPortal.SiteImageService.Notavailable.jpg"));

            Image img = (Image)b;

            context.Response.ContentType = "image/jpg";

            img.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
        }