---
title: "Download image from URL in C#"  
description: "Download image from URL in C#"  
author: "Madam Walker"  
published: 2013-10-05  
updated: 2013-10-21  
canonical: https://www.mindstick.com/forum/1614/download-image-from-url-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Download image from URL in C#

I know that there are a small amount of similar [questions](https://www.mindstick.com/blog/124895/hp-hpe0-s54-cheat-sheet-exam-questions-bank-for-guaranteed-success) but I have get a [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) with the found suggestions.

I tried this:

```
Image tmpimg = null;
HttpWebRequest _httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
HttpWebResponse _httpWebReponse = (HttpWebResponse)httpWebRequest.GetResponse();
Stream _stream = httpWebReponse.GetResponseStream();
return Image.FromStream(_stream);
```

\
But on the last line when I type in [Image](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character). FromStream can´t be found. What can I do?

## Replies

### Reply by Donna Klinton

Hi there\
I've tried this code to download image from url:\

```
using RasterEdge.Imaging.Basic.Core;using RasterEdge.Imaging.Basic.Codec;using RasterEdge.Imaging.Basic;namespace RE__Test{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {            REImage reImage = REFile.GetImageFromURL("http://www.rasteredge.com/Sample.png", new PNGDecoder());            REFile.SaveImageFile(reImage, "c:/reimage.png", new PNGEncoder());        }    }}But it failed.What's wrong with my code.
```

### Reply by Anonymous User

You should be use **using System.Drawing;**


---

Original Source: https://www.mindstick.com/forum/1614/download-image-from-url-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
