473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,396 developers and data experts.

Using Imagebox in Silverlight with C#.Net Code.

Hi Friends,
The reason to write such a simple article is that after searching a lot i came to know that not too many people are aware that there is no Picturebox available in Silverlight and the alternative is Imagebox.
Here is a basic example of how to use a Imagebox.
Expand|Select|Wrap|Line Numbers
  1. This you can code on click event of button or anywhere according to your requirement,it will open a dialog box and let u select a image.
  2. Here image1 is my Imagebox name.
  3.  OpenFileDialog objFileDialog = new OpenFileDialog();
  4.             bool? IsSelected = objFileDialog.ShowDialog();
  5.             objFileDialog.Filter = "Pictures (*.jpg)|*.jpg";
  6.             objFileDialog.FilterIndex = 1;
  7.             if (IsSelected == true)
  8.             {
  9.                 BitmapImage bitImage = new BitmapImage();
  10.                 bitImage.SetSource(objFileDialog.File.OpenRead());
  11.                 image1.Source = bitImage;
  12.                 //Image1 is object of Image
  13.             }  
  14.  
Aug 25 '11 #1
0 3525

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Micus | last post by:
Greetings, I need to execute 2 applications from an application or batch file. The first app launched has the user enter a product key and the app's exit code will be 0 (failed) or 1...
3
by: Paul | last post by:
Just wondering if there is a way to give a control focus when the page loads, for example so the user could start typing in a text box before clicking on it? Thanks, -- Paul G Software engineer.
3
by: veera | last post by:
Is it possible to give control focus using Asp.net code??
7
by: | last post by:
Hello, I would like to do the following from a asp.net button click: <form method="POST" action="https://www.1234.com/trans_center/gateway/direct.cgi"> <input type="hidden" name="Merchant"...
3
by: manu.kanwarpal | last post by:
Hi, Our team is working on a network monitoring tool. We have identified "WINPCAP" as the library that provides support for packet capturing. WINPCAP is made for WIN32 applications and is coded in...
1
by: jujulal | last post by:
Hi all, How could i get CDROM Drive Letter using VB6.0 code. Where i run application that should get cdrom drive letter so, i need help.
2
by: lewisms | last post by:
Hello all, I am quite new to c++/. Net so please don't shoot me down for being a newbie. Any way I am trying to make a simple multithreading program that is just to learn the ideas behind it...
23
by: Python Maniac | last post by:
I am new to Python however I would like some feedback from those who know more about Python than I do at this time. def scrambleLine(line): s = '' for c in line: s += chr(ord(c) | 0x80)...
1
by: Matt | last post by:
I've got a .NET app that takes 10 seconds to load on a cold boot with older machines. This is confusing to users. I've put in a .NET splashscreen, which helps, but even that can take several...
1
by: Aj Singh | last post by:
I have mulitple websites using the same code but different web.config files. Is there a way where I can achieve not having multiple copies of the same code? so its easy to mantain? Thanks
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
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,...

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.