TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
parasuram potharaju
NA
1
1.2k
controls ( button and image)
Oct 16 2013 7:05 AM
how can i generate the images randomly by clicking the button ?,
i used button control and placed the image controller on the button . I'm unable to generate the images randomly , please help me how can i do .....
i try by this code , but i can generate only one image at one click. if try to click the button it is not generating the other images....
private void button1_Click_1(object sender, RoutedEventArgs e)
{
Random r = new Random();
int d = r.Next(1,7);
textBlock1.Text = d.ToString();
switch (d)
{
case 1:
myimage.Source = new BitmapImage(new Uri(@"/imagedice;component/Images/dice1.png", UriKind.Relative));
break;
case 2:
myimage.Source = new BitmapImage(new Uri(@"/imagedice;component/Images/dice2.png", UriKind.Relative));
break;
case 3:
myimage.Source = new BitmapImage(new Uri(@"/imagedice;component/Images/dice3.png", UriKind.Relative));
break;
case 4:
myimage.Source = new BitmapImage(new Uri(@"/imagedice;component/Images/dice4.png", UriKind.Relative));
break;
case 5:
myimage.Source = new BitmapImage(new Uri(@"/imagedice;component/Images/dice5.png", UriKind.Relative));
break;
case 6:
myimage.Source = new BitmapImage(new Uri(@"/imagedice;component/Images/dice6.png", UriKind.Relative));
break;
}
}
Reply
Answers (
1
)
tell me libraries for convertion of audio and video formats
want to make video player for web application