Thursday, 28 January 2010

Good quality icon packs for web and Windows development

Thanks to a helpful post from:

http://www.queness.com/post/320/22-beautiful-icon-packs-for-web-design-and-development
  • Circular Icons

  • bwpx.icns

  • Gallery 2 Icons

  • KDE Icons

  • Credit Card Icons

  • Fugue Icons

  • Diagonal Icons

  • Danish Icons

  • LED Pixel Icons

  • Flag Icons

  • Mini Icons

  • Onebit Icons

  • WYSIWYG Sapphire Icons

  • Watercolor Icon Pack

  • Sweetie Basepack Icons

  • Sweetie WebCommunication Icons

  • Brand Spanking New Mini Icons

  • TwoTones Icons

  • Twotiny Icon Set

  • Splashy Fish Icons

  • Web Injection Icons

  • Mania Icons
  • Add comments to any website page

    Handy universal comments system with simple integration:
    http://disqus.com/
    Disqus (dis·cuss • dĭ-skŭs') is all about changing the way people think about discussion on the web. We're big believers in the conversations and communities that form on blogs and other sites.

    Take website screenshot using ASP.NET

    Utilising a hidden web browser control it is possible to take a screenshot of any website. The code shown below is based on an article at plentyofcode.com (sorry the site now appears to be offline May 2012) but I have translated it from VB.NET to C# and will work in .NET so theoretically for any Windows or ASP.NET web project.
    using System;
    using System.Drawing;
    using System.Drawing.Imaging;
    using System.Windows.Forms;
    using System.Diagnostics;
    
    namespace WebsiteScreenshot
    {
        public class GetImage
        {
            private int s_Height; private int s_Width; private int f_Height; private int f_Width; private string myURL;
    
            public int ScreenHeight { get { return s_Height; } set { s_Height = value; } }
            public int ScreenWidth { get { return s_Width; } set { s_Width = value; } }
            public int ImageWidth { get { return f_Width; } set { f_Width = value; } }
            public int ImageHeight { get { return f_Height; } set { f_Height = value; } }
            public string Website { get { return myURL; } set { myURL = value; } }
    
            public GetImage(string website, int screenWidth, int screenHeight, int imageWidth, int imageHeight)
            {
                myURL = website; 
                s_Width = screenHeight; 
                s_Height = screenHeight; 
                f_Height = imageHeight; 
                f_Width = imageWidth;
            }
    
            public Bitmap GetBitmap()
            {
                WebPageBitmap shot = new WebPageBitmap(this.Website, this.ScreenWidth, this.ScreenHeight); shot.GetIt();
                Bitmap pic = shot.DrawBitmap(this.ImageHeight, this.ImageWidth);
                return pic;
            }
        }
    
        class WebPageBitmap
        {
            WebBrowser myBrowser; string url; int height; int width;
    
            public WebPageBitmap(string url, int width, int height)
            {
                this.height = height; this.width = width; this.url = url;
                myBrowser = new WebBrowser(); myBrowser.ScrollBarsEnabled = false; myBrowser.Size = new Size(this.width, this.height);
            }
    
            public void GetIt()
            {
                myBrowser.Navigate(this.url);
                while (myBrowser.ReadyState != WebBrowserReadyState.Complete)
                {
                    Application.DoEvents();
                }
            }
    
            public Bitmap DrawBitmap(int theight, int twidth)
            {
                Bitmap myBitmap = new Bitmap(width, height); Rectangle drawRect = new Rectangle(0, 0, width, height);
    
                myBrowser.DrawToBitmap(myBitmap, drawRect);
    
                Image imgOutput = myBitmap; Image oThumbnail = new Bitmap(twidth, theight, imgOutput.PixelFormat); Graphics g = Graphics.FromImage(oThumbnail); g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed; g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear;
    
                Rectangle oRectangle = new Rectangle(0, 0, twidth, theight); g.DrawImage(imgOutput, oRectangle);
    
                try 
                { 
                    return new Bitmap(oThumbnail); 
                }
                catch (Exception ex) 
                { 
                    return null; 
                }
                finally 
                { 
                    imgOutput.Dispose(); 
                    imgOutput = null; 
                    myBrowser.Dispose(); 
                    myBrowser = null; 
                }
            }
        }
    }
    

    Wednesday, 27 January 2010

    iPad is finally confirmed

    Apple’s new all singing all dancing device has been announced!

    See the live feed here: http://live.gdgt.com/2010/01/27/live-apple-come-see-our-latest-creation-tablet-event-coverage/

    Here’s what the Apple iPad looks like.

    Image courtesy of GdGt.com

    Friday, 15 January 2010

    Capture screenshot in C#

     

    A helpful article here from Geekpedia.

    This is fine for taking a standard screenshot from a Windows desktop. As an alternative solution I have a project here for taking a screenshot of a website using any .NET environment.