Geeks With Blogs
Nouman Zakir while (true) { Post.NewArticle(); }

A C# class that makes it easier to download images from the web.
Use the following code in your program to download image files
such as JPG, GIF, PNG, etc from the internet using WebClient class.

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Net;

public class DownloadImage
    private string imageUrl;
    private Bitmap bitmap;
    public DownloadImage(string imageUrl)
        this.imageUrl = imageUrl;
    public void Download()
            WebClient client = new WebClient();
            Stream stream = client.OpenRead(imageUrl);
            bitmap = new Bitmap(stream);
        catch (Exception e)
    public Bitmap GetImage()
        return bitmap;
    public void SaveImage(string filename, ImageFormat format)
        if (bitmap != null)
            bitmap.Save(filename, format);

Posted on Thursday, March 11, 2010 2:27 PM Programming , C# , .Net | Back to top

Comments on this post: C# Image Download

# re: C# Image Download
Requesting Gravatar...
I am very happy to know much about C# image download. I think you have shared an easy method to do this process. I have tried this method and it became successful. Thanks a lot for your guidance. Keep sharing such posts! hotels catalina island
Left by Fred on Sep 15, 2015 9:22 AM

Your comment:
 (will show your gravatar)

Copyright © Nouman Zakir | Powered by: | Join free