hi, I've new to telerik for WPF. Now i am going to develop a multi-touch campus map for guiding.
My code for the image as follows, but error is"Could not find a part of the path 'D:\campus_floorplan;component\images\directory_level1.png'."
Code:
private void get(int i)
{
ImageBrush b = new ImageBrush();
switch (i)
{
case 1:
{
b.ImageSource = new BitmapImage(new Uri("/campus_floorplan;component/images/directory_level1.png", UriKind.Relative));
b.Stretch = Stretch.Uniform;
this.Background = b;
};
break;
case 2:
{
b.ImageSource = new BitmapImage(new Uri("/campus_floorplan;component/images/directory_level2.png", UriKind.Relative));
b.Stretch = Stretch.Fill;
this.Background = b;
};
break;
case 3:
{
b.ImageSource = new BitmapImage(new Uri("/campus_floorplan;component/images/directory_level3.png", UriKind.Relative));
b.Stretch = Stretch.Fill;
this.Background = b;
};
break;
case 4:
{
b.ImageSource = new BitmapImage(new Uri("/campus_floorplan;component/images/directory_level4.png", UriKind.Relative));
b.Stretch = Stretch.Fill;
this.Background = b;
};
break;
}
}
private void level1_touchdown(object sender, TouchEventArgs e)
{
radMap.Visibility = Visibility.Collapsed;
this.get(1);
}
So how to get the correct path for image??
Hope you can help me.
Thank you very much.
My code for the image as follows, but error is"Could not find a part of the path 'D:\campus_floorplan;component\images\directory_level1.png'."
Code:
private void get(int i)
{
ImageBrush b = new ImageBrush();
switch (i)
{
case 1:
{
b.ImageSource = new BitmapImage(new Uri("/campus_floorplan;component/images/directory_level1.png", UriKind.Relative));
b.Stretch = Stretch.Uniform;
this.Background = b;
};
break;
case 2:
{
b.ImageSource = new BitmapImage(new Uri("/campus_floorplan;component/images/directory_level2.png", UriKind.Relative));
b.Stretch = Stretch.Fill;
this.Background = b;
};
break;
case 3:
{
b.ImageSource = new BitmapImage(new Uri("/campus_floorplan;component/images/directory_level3.png", UriKind.Relative));
b.Stretch = Stretch.Fill;
this.Background = b;
};
break;
case 4:
{
b.ImageSource = new BitmapImage(new Uri("/campus_floorplan;component/images/directory_level4.png", UriKind.Relative));
b.Stretch = Stretch.Fill;
this.Background = b;
};
break;
}
}
private void level1_touchdown(object sender, TouchEventArgs e)
{
radMap.Visibility = Visibility.Collapsed;
this.get(1);
}
So how to get the correct path for image??
Hope you can help me.
Thank you very much.