Visual Programing CS 411 Assignment 2 Due Date 28-01-2019 Solution
Solution of CS 411 Assignment No 2 Due Date 28-01-2019 is given in video below
Part 1
Part 1
Part 2
YouTube Channel Link : Click Here to Visit
Subscribe my Channel to get future updates.
Code Used in Video for the Solution of CS 411 Assignment No 2 is as below;
Steps Involved:
1- first of all set the name Id of image view as "imageview" and id for Browse Button as "browsetbn", for zoom button Id set to "zinbtn" and for zoom out button id is "zouttbtn" and copy the code below and paste it into Visual Studio given place under
2. Double click on Brows Button (You will directly go to cs. file below the browse button c# code and now here copy and paste the following code between {} :
private void Zbutton_Click(object sender, RoutedEventArgs e)
{
picload.Height = (int)(picload.Height + (picload.Height * 0.10));
picload.Width = (int)(picload.Width + (picload.Width * 0.10));
{
picload.Height = (int)(picload.Height + (picload.Height * 0.10));
picload.Width = (int)(picload.Width + (picload.Width * 0.10));
}
private void Browsebtn_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog opfd = new OpenFileDialog();
opfd.Title = "Select a picture";
opfd.Filter = "All supported graphics|*.jpg;*.jpeg;*.png|" +
"JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|" +
"Portable Network Graphic (*.png)|*.png";
if (opfd.ShowDialog() == true)
{
picload.Source = new BitmapImage(new Uri(opfd.FileName));
}
{
OpenFileDialog opfd = new OpenFileDialog();
opfd.Title = "Select a picture";
opfd.Filter = "All supported graphics|*.jpg;*.jpeg;*.png|" +
"JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|" +
"Portable Network Graphic (*.png)|*.png";
if (opfd.ShowDialog() == true)
{
picload.Source = new BitmapImage(new Uri(opfd.FileName));
}
}
private void Browsebtn_Copy_Click(object sender, RoutedEventArgs e)
{
picload.Height = (int)(picload.Height - (picload.Height * 0.10));
picload.Width = (int)(picload.Width - (picload.Width * 0.10));
}
}
}
{
picload.Height = (int)(picload.Height - (picload.Height * 0.10));
picload.Width = (int)(picload.Width - (picload.Width * 0.10));
}
}
}
How to zoom picture/image in c# with buttons code is given above
Then just click on debug button to start program and then do as in video... for full tutorial just watch the Video given above..
Then just click on debug button to start program and then do as in video... for full tutorial just watch the Video given above..
Note: To avoid zero marks I suggest you to change button ids and little bit change in c# code..
0 Comments