Skip to main content
Home Forums General Silverlight Getting Started How to get Image Url(Path) from ImageSource
5 replies. Latest Post by spbAngel on July 4, 2009.
(0)
kranthi_015
Member
12 points
3 Posts
10-01-2008 2:30 AM |
Hi,
I have a ImageBrush and have given ImageSource as Bitmap, now i want to get the ImageUrl of the ImageSource.
My image source is
args.ImageSource = ((Path)sender).Fill.GetValue(ImageBrush.ImageSourceProperty) as BitmapImage;
but, I am not able to get the Image url of the args.ImageSource.
Thanks in advance,
Kranthi
HarshBar...
Star
9908 points
1,719 Posts
10-01-2008 8:29 AM |
Try with this code.
You can Minimize this one..
//Page.Xaml
//Page.xaml.cs
{
img.Source =
LayoutRoot.Children.Add(img);
}
10-17-2008 8:03 AM |
This is what exactly i need....
thanks a lot HarshBardhan
balukr54
124 points
143 Posts
01-05-2009 12:03 AM |
Hi Harsh How can i change the image in imagebrush dynamicallythis is my code
<Path x:Name="pathTest" Margin="77,37,198.5,138.5" Stretch="Fill" Stroke="#FF000000" Data="M81,39 L81,161 L200.5,158.5 L199.00624,39.5 L77.51458,37.5"> <Path.Fill> <ImageBrush x:Name="myBrush" ImageSource="images/22.jpg"></ImageBrush>//this have to refreshed //dynamicaaly. </Path.Fill> </Path> <Canvas Margin="189,200,8,68"> <RadioButton x:Name="rb1" Content="Image1" Checked="rb1_Checked"/> <RadioButton x:Name="rb2" Content="Image2" Checked="rb2_Checked" Canvas.Left="68"/> <RadioButton x:Name="rb3" Content="Image3" Checked="rb3_Checked" Canvas.Left="136"/> </Canvas>
private void rb1_Checked(object sender, RoutedEventArgs e) { //how can i change the image?? i need to chane the image of(myBrush)and update it with new image }private void rb2_Checked(object sender, RoutedEventArgs e) { // i need to chane the image of(myBrush)and update it with new image }private void rb3_Checked(object sender, RoutedEventArgs e) { // i need to chane the image of(myBrush)and update it with new image }
Thanks balu
01-05-2009 12:43 AM |
Hi
i got the solution
imgBrush.ImageSource =
spbAngel
2 points
1 Posts
07-04-2009 4:33 AM |
string a = ((System.Windows.Media.Imaging.BitmapImage)(((imgBrush)).ImageSource)).UriSource.ToString();