472,325 Members | 1,025 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,325 software developers and data experts.

Web Image in Windows Form?

OK, this should be my last question for the day. I have spent a couple hours
on google trying to figure this out but I probibly just dont know what I
really need to be searching for.

I have a Windows Form program that calls a web service that will return (as
a string) the full url to an image hosted on an external webserver. My
question is how do I then display this image in my form, or is this even
possible. It seems like it should be pretty simple, but I probibly just dont
know what I really need to be searching for.

Thanks Again, Jeff Griffin
Nov 15 '05 #1
4 3893
You could invoke IE within the winform which would obviously allow you to
show the image within it, look at this
http://www.codeproject.com/csharp/wi...asp?print=true and
http://blog.monstuff.com/archives/000052.html

Of course you may also be able to simply use a richtext control in your
winform from the System.Windows.Forms.RichTextBox class and reference the
image from within that, or use a picture box control as they can display
GIF's - not sure if you can point them to a URL but I expect so.

You may also find this image viewer (c# code) useful as it uses a picture
box.
http://www.dotnet247.com/247referenc...arpcorner.com/
winforms/ImageViewerST.asp

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------

"Jeff Griffin" <sf******@hotmail.NOSPAM.com> wrote in message
news:OM**************@TK2MSFTNGP10.phx.gbl...
OK, this should be my last question for the day. I have spent a couple hours on google trying to figure this out but I probibly just dont know what I
really need to be searching for.

I have a Windows Form program that calls a web service that will return (as a string) the full url to an image hosted on an external webserver. My
question is how do I then display this image in my form, or is this even
possible. It seems like it should be pretty simple, but I probibly just dont know what I really need to be searching for.

Thanks Again, Jeff Griffin

Nov 15 '05 #2
In article <OM**************@TK2MSFTNGP10.phx.gbl>, sfajeff2
@hotmail.NOSPAM.com says...
OK, this should be my last question for the day. I have spent a couple hours
on google trying to figure this out but I probibly just dont know what I
really need to be searching for.

I have a Windows Form program that calls a web service that will return (as
a string) the full url to an image hosted on an external webserver. My
question is how do I then display this image in my form, or is this even
possible. It seems like it should be pretty simple, but I probibly just dont
know what I really need to be searching for.

Thanks Again, Jeff Griffin

System.Net.WebClient source = new System.Net.WebClient();
Stream myData = source.OpenRead("http://somewhere.com/img.gif");
System.Drawing.Bitmap myPic = new System.Drawing.Bitmap(myData);

and of course all this have to be with try/catch blocks, and do not
forget to close the stream :)
Hope that helps
Sunny
Nov 15 '05 #3
Thank you so much yall! I will give these a try after dinner and report
back.

Jeff Griffin

PS - To everyone on these boards, keep up the great work. The speed with
which you can get a question answered here is incredible!
Nov 15 '05 #4
I ended up using Sunny's suggustion and it works awesome! Thank you so much!

Jeff Griffin
Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Anonymous | last post by:
I have a Windows Form with a graphic on it (an icon on a toolbar). My form is localized in English and French. I modified the English version image,...
2
by: sunnyz | last post by:
hi all plz help me in displaying image on button in windows form from a url or website.I am using C#.The image should not be stored on local...
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my...
7
by: moondaddy | last post by:
I'm painting images onto a windows form using this method: e.Graphics.DrawImageUnscaled(m_ItemImage, x, y) every time I select a product. ...
2
by: AS | last post by:
Hi, I have a windows form with a background image - set through the forms background image property. The form also has panels and icons on top of...
1
by: Daniel López | last post by:
Hi, I'm trying to create a non rectangular windows form using a PNG image with transparent zones and I want that this zones appears as...
9
by: mohit.akl | last post by:
Hey guys & gals I am havng trouble modifying the control box. I want to make the maximise button invisible and have minimisise button instead of...
1
by: Rohit111111 | last post by:
I have my base form which has background image , tool bar etc,All other forms inherit it. The background image size is162kb and it is in PNG...
0
by: Vyas111111 | last post by:
I have my base form which has background image , tool bar etc,All other forms inherit it. The background image size is162kb and it is in PNG...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.