473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

image on button in windows form from url on the fly

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 from the website
and display it on the button

Nov 16 '05 #1
2 2357
Sunnyz,

Do us a favor and do not multipost to dotnet newsgroups, I see no reason why
you send this message to the newsgroup VB.Net. I have answered you in the
newsgroup VBNet as well with almost the same message. Beneath is a sample I
made for you.

\\\
private void Page_Load(object sender, System.EventArgs e)
{
this.ImageButton1.ImageUrl =
"http://msdn.microsoft.com/vbasic/art/vbasic03/hls_VB_overview.gif";
}
private void ImageButton1_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
String str;
str = "<script language=javascript>
{window.open('http://msdn.microsoft.com/vbasic/productinfo/overview/default.
aspx');} </script>";
RegisterStartupScript("Startup", str);
}
///
I hope this helps?

Cor

"sunnyz" <su****@lycos-dot-com.no-spam.invalid>
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 from the website
and display it on the button

Nov 16 '05 #2
Hello...

The way you can do it depends on how you are treating the image.

If you can make a local copy of your remote image, you can do this:

myButton.Image = Image.FromFile("C:\\MyLocalImage.jpg");
But if you can retrieve an array of bytes (the bytes that represents the
file content) you can do this:

// Let's say someObject is an instance of a class
// you've already created for working with your images
byte[] bytes = someObject.GetRemoteImgage();
MemoryStream stream = new MemoryStream(bytes);
myButton.Image = Image.FromStream(stream);

I hope it will be helpful...

Bye...
"sunnyz" <su****@lycos-dot-com.no-spam.invalid> escribió en el mensaje
news:41**********@Usenet.com...
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 from the website
and display it on the button

Nov 16 '05 #3

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

Similar topics

2
by: Bill N. | last post by:
Using VB .Net 2003 Standard Edition. This simple form has a "File in Use" problem while the executable is running. Created this simple program to make sure that I hadn't done something in my...
15
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and...
0
by: jez | last post by:
I'm programming in C# for a PPC, and trying to display an image from the start, i.e. as soon as the program launches. I've tried (as explained in Microsoft's .NET Compact Framework book) to use two...
1
by: Novice | last post by:
I'm afraid I will incur the wraith of Mr. Powell on this one - but I did read his #1 FAQ and some others and I still can't figure this out. I created this little c# app. and I have a PictureBox...
0
by: Deepak C.G via .NET 247 | last post by:
I want to dispose the image object in my child form, unless I won't dispose this object i can't delete the image file in my folder. I get this error in MDIparent form "An unhandled exception...
1
by: Phil_Cam | last post by:
Hello All On a webpage I have a standard paypal image button for purchases. I am trying to set it up so that it only shows up or is endabled when text is entered into a textbox and a button is...
0
by: David | last post by:
Hello all. I am trying to implement my first server control and have run into two problems that I cannot solve. I need the assistance of someone with more experience. My goal was to create an...
16
by: browntown | last post by:
so I have this application I'm nearly finished with. The only thing the client has requested is the ability to submit the form by pressing "enter". I didn't think this would be a huge pain in the...
4
by: Marcolino | last post by:
Hi, I have simple needs but I don't know how to implement it. I have application that create Dynamic Button. I need to set the image on this button, getting the icon from a form. So pratically...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.