1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| foreach (Donnee d in mDos.mesImages)
{
if (columnCourante == 0)
{
RowDefinition rowDef1 = new RowDefinition();
imageGrid.RowDefinitions.Add(rowDef1);
rowCourante++;
}
columnCourante++;
monImage1 = new Image() { Source = new BitmapImage(new Uri(dossierImage + d.nom, UriKind.Relative)),Width=100, Opacity=100 };
monImage = new ImageBrush() { ImageSource = new BitmapImage(new Uri(dossierImage + d.nom, UriKind.Relative)) };
maBorder1 = new Border()
{
Background = monImage,
Child=monImage1,
BorderBrush = new SolidColorBrush(Colors.Black),
Margin = new Thickness(20, 20, 20, 20),
CornerRadius = new CornerRadius(10),
BorderThickness = new Thickness(1.0),
VerticalAlignment=VerticalAlignment.Center,
HorizontalAlignment=HorizontalAlignment.Center
};
monImage1.MouseLeftButtonDown += new MouseButtonEventHandler(monImage1_MouseLeftButtonDown);
imageGrid.Children.Add(maBorder1);
Grid.SetColumn(maBorder1, columnCourante);
Grid.SetRow(maBorder1, rowCourante - 1);
if (columnCourante == 5)
{
columnCourante = 0;
}
} |
Partager