Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Border's heigh and image's height problems
3 replies. Latest Post by shintaro on June 11, 2009.
(0)
shintaro
Member
1 points
2 Posts
06-10-2009 7:09 PM |
i have a problem with object image and border, the image's height isn't same than the border. All my borders have the same height, which is the height of the bigger image.
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
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), }; monImage1.MouseLeftButtonDown += new MouseButtonEventHandler(monImage1_MouseLeftButtonDown); imageGrid.Children.Add(maBorder1); Grid.SetColumn(maBorder1, columnCourante); Grid.SetRow(maBorder1, rowCourante - 1); if (columnCourante == 5) { columnCourante = 0; } }
Help me please
microsof...
Contributor
2890 points
564 Posts
06-11-2009 12:41 AM |
So, what you want? Can you explain your problem?
SharpGIS
3387 points
611 Posts
Set Horizontal- and VerticalAlignment on the border to prevent it from scaling to the size of the parent container. It defaults to stretch.
06-11-2009 6:39 AM |
Thanks SharpGIS, my problem resolved with your solution.