![]() You can control this behavior by setting the Stretch property of TileBrush to Uniform or UniformToFill, which causes the brush to preserve the aspect ratio of the image. In the preceding example, the image is stretched to fill the button, possibly distorting the image. Use the brush to paint the button's background.īy default, an ImageBrush stretches its image to completely fill the area that you are painting. ImageBrush berriesBrush = new ImageBrush() Public class PaintingWithImagesExample : PageīerriesButton.Foreground = Brushes.White īerriesButton.FontWeight = FontWeights.Bold įontSizeConverter sizeConverter = new FontSizeConverter() īerriesButton.FontSize = (Double)sizeConverter.ConvertFromString("16pt") īerriesButton.FontFamily = new FontFamily("Verdana") īerriesButton.Padding = new Thickness(20.0) īerriesButton.HorizontalAlignment = HorizontalAlignment.Left The following example paints the Background of a button by using an ImageBrush. An ImageBrush displays a single image, which is specified by its ImageSource property. This example shows how to use the ImageBrush class to paint an area with an image. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |