Skip to Main Content
Visual Basic 2015 Unleashed
book

Visual Basic 2015 Unleashed

by Alessandro Del Sole
July 2015
Intermediate to advanced content levelIntermediate to advanced
1300 pages
87h 27m
English
Sams
Content preview from Visual Basic 2015 Unleashed

Applying an ImageBrush

You can fill a visual element with an image file by using the ImageBrush brush. This object is useful even if you want to fill text with image textures. The following code snippet shows how to apply an ImageBrush as a button background and as the text foreground color:

<StackPanel Grid.Row="3" Orientation="Horizontal">    <Button Width="100" Margin="5" Content="Hello!"        Foreground="Yellow">        <Button.Background>            <ImageBrush Opacity="0.5"                ImageSource=          "/StylesBrushesTemplatesAnimations;component/Images/Avatar.jpg" />        </Button.Background>    </Button>    <TextBlock Margin="5"               FontFamily="Segoe UI" FontSize="40" Text="Hello!"

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Visual Basic 2015

Beginning Visual Basic 2015

Bryan Newsome

Publisher Resources

ISBN: 9780134196664Purchase book