• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

SilverLight Brushes

SilverLight Brushes are used to fill colors, images and videos in silver light objects.

The silver light supports five types of brushes

  1. Solid color brush
  2. Linear gradient brush
  3. Image brush
  4. Radial Gradient Brush
  5. Video Brush

Solid Color Brush

This brush is used to fill single color in the silver light controls, while working with brushes we have to work with color related properties.

Example:- Open we silver light application

Go to XAML Mode
In the grid tag

<grid X:Name = “layout Root” Background = “white”>
<Rectangle X:Name= “r1” height = “100” width = “300” Stroke = “blue” stroke thickness = “10” stroke dash array = “2” stroke dash offset = “5”>

<Rectangle. fill>

</solid color brush color = “Red”>

</solid color brush>

</Rectangle. fill>

</rectangle>

</grid>

Stroke dash array property gives border styles

Stroke dash offset property rotates the border

Rectangle. Fill tag gives special features to the fill property

Linear Gradient Brush

This brush is used to fill multiple colors in the silver light controls in the linear order, while working with this brush we can work with any color related property

Example:- open new silver light application

Go to XAML mode

In the grid tag

<grid X:Name = “layout Root” Background= “white”>

<Rectangle X: Name= “r1” Height = “150” width = “250” Stroke = “Blue” stroke thickness = “10”>

<rectangle .fill>

<linear Gradient brush start point = “0,0” end point = “1,1”>

<Gradient stop offset = “.2” color = “Red” > < /Gradient stop>

<Gradient stop offset = “.4” color = “blue”> </gradient stop>

<gradient stop offset = “.6” color = ‘Green”> </gradient stop>

<gradient stop offset = ”.8” color = “black”> </gradient stop>

</linear Gradient brush>

</Rectangle .fill>

</rectangle>

</Grid>

àThe linear gradient brush gives multiple liners based on start point and end point properties, two properties takes x, y locations, by default two properties default parameter  values are (0,0) and (1,1)

àThe start point property takes the value from upper left comes,

àEnd point property takes the value from bottom right corner using gradient stop tag we can fill  one color in the silver light control, using this tag we can set color location and filling color.

Image Brush

This brush is used to fill one image in the silver light controls, while working with this brush we can work with any color related property           

  Example:- open new silver light application

Go to XAML mode

In the canvas tag

<canvas>

<text block x: name = “t1” Text = “welcome”  Font size = “100”>

<Text Block . Foreground>

<Image Brush Image source = “d:lone. Jpg” > </Image brush>

</Text block. Foreground>

</text block>

<ellipse X:name = “el” Height = “150” width = “200” stroke = “blue” stroke thickness = “10” canvas. Top = “120”>

<ellipse .fill>

<Image brush Image source = “d./one.jpg”> </Image brush>

</ellipse .fill>

</ellipse>

</canvas>

Radial Gradient Brush

This brush is used to fill multiple colors in the silverlight controls in the circular order, while working with this brush we can work with all color related properties.

Example:- Open new silver light Application

Go to XAML Mode

In the grid tab

(0,0)        Control

Screenshot_5

<Grid X:Name=”Layout Root” Background = “white”>

<Ellipe X:Name = “el” Height = “200” width = “300” stroke = “blue” stroke thickness = “10”>

<Ellipse.fill>

<Radial gradient brush gradient origin = “.0,.5” radius = “.4” radius Y= “.5”>

<Gradient Stop Offset = “.2” color = “Red”> </Gradient stop>

<Gradient stop offset = “.4” color = “Green”> </gradient stop>

<Gradient stop offset = “.6” color = “yellow”> </gradient stop>

<Gradient stop offset =”.8” color = “black”> </Gradient stop>

</Radial gradient Brush>

</ellipse. Fill>

</Ellipse>

</Grid>

Using Gradient Origin property we can set gradient local point, this property takes two arguments X location and Y location using Radius X, Radius Y properties we can set the X gradient size and Y Gradient size

Video Brush

This Brush is used to fill video in the silver light control, the video Brush is depending on the media element control

Summary
Review Date
Reviewed Item
SilverLight Brushes
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on SilverLight Brushes"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.

    Support


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.