473,473 Members | 1,581 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 3969
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, the French version stayed the same (old 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 computer...the function shud get the image directly...
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 queries.This is yet another strange issue, I am...
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. However, some products don't have an image so when a...
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 it. When this form is loading, there's a...
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 transparent in the windows form. Before, on VS.NET 2003,...
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 it. Like this _ X (not like _ o X ) How...
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 format.All the other forms also has many images since...
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 format.All the other forms also has many images since we...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.