Guest User

Untitled

a guest
Feb 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. void image()
  2. {
  3. for (int i = 1; i <= 25; i++)
  4. {
  5. Image image = new Image();
  6. centerGrid.Children.Add(image);
  7. image.Stretch = Stretch.Fill;
  8. image.Source = new BitmapImage(new Uri("Image/back.png", UriKind.Relative));
  9. }
  10. }
  11.  
  12. void image()
  13. {
  14. for (int i = 1; i <= 5; ++i)
  15. {
  16. for (int j = 0; j < 5; ++j)
  17. {
  18. Image image = new Image();
  19.  
  20. image.SetValue(Grid.RowProperty, i);
  21. image.SetValue(Grid.ColumnProperty, j);
  22.  
  23. grid.Children.Add(image);
  24. image.Stretch = Stretch.Fill;
  25. image.Source = new BitmapImage(new Uri("Images/1.png", UriKind.Relative));
  26. }
  27. }
  28. }
  29.  
  30. void image()
  31. {
  32. for (int i = 1; i <= 25; ++i)
  33. {
  34. Image image = new Image();
  35.  
  36. // + обработка 0 значения..
  37. image.SetValue(Grid.RowProperty, i % 5);
  38. image.SetValue(Grid.ColumnProperty, i / 5);
  39.  
  40. grid.Children.Add(image);
  41. image.Stretch = Stretch.Fill;
  42. image.Source = new BitmapImage(new Uri("Images/1.png", UriKind.Relative));
  43. }
  44. }
  45.  
  46. Grid.SetRow(image, i);
  47. Grid.SetColumn(image, j);
Add Comment
Please, Sign In to add comment