• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1969
  • Last Modified:

C# Winform, display image column by URL.

How can I display image column with URL in datagridview.
Ex: Cell value: \\10.107.11.11\image.jpg  --> display image in cell, not hyperlink.

Please help me!
0
JameMeck
Asked:
JameMeck
  • 2
  • 2
1 Solution
 
Jacques Bourgeois (James Burger)PresidentCommented:
The display of images in the DataGridView is described in the framework documentation at http://msdn.microsoft.com/en-us/library/2ab8kd75.aspx
0
 
JameMeckAuthor Commented:
How to display this string: \\10.107.11.11\image.jpg  to Bitmap?
0
 
Jacques Bourgeois (James Burger)PresidentCommented:
System.Net.WebClient webSource = new System.Net.WebClient ( );
byte[] data = webSource.DownloadData ( "http://10.107.11.11/image.jpg  ");
System.IO.MemoryStream pipe = new System.IO.MemoryStream(data);
Image jpgImage = Image.FromStream(pipe);

Open in new window

Then use the the code referenced in my last post to display jpgImage.
0
 
JameMeckAuthor Commented:
Thanks! I got it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now