1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how to create a site thumb image ?

Discussion in 'C#' started by JJnacy, Apr 26, 2009.

  1. #1
    like Alexa has a thumb picture for each site

    how to do that via asp?


    Thanks,
     
    JJnacy, Apr 26, 2009 IP
  2. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #2
    http://www.websitesscreenshot.com/
    provides a free version which has a watermark on all the images or it costs about $100 for the full version which doesn't have the watermark. It comes with C# and VB .NET sample code and is easy enough to install and use.
     
    camjohnson95, Apr 26, 2009 IP
    JJnacy likes this.
  3. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #3
    also provides some useful functions for parsing HTML.
     
    camjohnson95, Apr 26, 2009 IP
  4. pitagora

    pitagora Peon

    Messages:
    247
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    pitagora, Apr 27, 2009 IP
    JJnacy likes this.
  5. shan23

    shan23 Peon

    Messages:
    227
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    is there any free software available
     
    shan23, Apr 29, 2009 IP
  6. MayurGondaliya

    MayurGondaliya Well-Known Member

    Messages:
    1,233
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    170
    #6
    It is not easy to generate the thumb images. It is better to use third party API, DomainTools.com provide this API. Try it.
     
    MayurGondaliya, Apr 30, 2009 IP
    JJnacy likes this.
  7. VishalVasani

    VishalVasani Peon

    Messages:
    560
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hello,

    You can create in APS.NET but for classic asp you required component.
    You can also create website thumb easily in PHP.
    Furthermore many website provides this type of services below is one of them search in google you will fine it easily

    Here is code for C#: Generate WebPage Thumbmail Screenshot Image

    
    
    //Codes
    
    public Bitmap GenerateScreenshot(string url)
    {
        // This method gets a screenshot of the webpage
        // rendered at its full size (height and width)
        return GenerateScreenshot(url, -1, -1);
    }
    
    public Bitmap GenerateScreenshot(string url, int width, int height)
    {
        // Load the webpage into a WebBrowser control
        WebBrowser wb = new WebBrowser();
        wb.ScrollBarsEnabled = false;
        wb.ScriptErrorsSuppressed = true;
        wb.Navigate(url);
        while (wb.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); }
    
    
        // Set the size of the WebBrowser control
        wb.Width = width;
        wb.Height = height;
    
        if (width == -1)
        {
            // Take Screenshot of the web pages full width
            wb.Width = wb.Document.Body.ScrollRectangle.Width;
        }
    
        if (height == -1)
        {
            // Take Screenshot of the web pages full height
            wb.Height = wb.Document.Body.ScrollRectangle.Height;
        }
    
        // Get a Bitmap representation of the webpage as it's rendered in the WebBrowser control
        Bitmap bitmap = new Bitmap(wb.Width, wb.Height);
        wb.DrawToBitmap(bitmap, new Rectangle(0, 0, wb.Width, wb.Height));
        wb.Dispose();
    
        return bitmap;
    } 
    
    //Usage
    
    // Generate thumbnail of a webpage at 1024x768 resolution
    Bitmap thumbnail = GenerateScreenshot("http://pietschsoft.com", 1024, 768);
    
    // Generate thumbnail of a webpage at the webpage's full size (height and width)
    thumbnail = GenerateScreenshot("http://pietschsoft.com");
    
    // Display Thumbnail in PictureBox control
    pictureBox1.Image = thumbnail;
    
    /*
    // Save Thumbnail to a File
    thumbnail.Save("thumbnail.png", System.Drawing.Imaging.ImageFormat.Png);
    */ 
    
    Code (markup):
     
    VishalVasani, May 6, 2009 IP
    JJnacy likes this.