A brush paints an area with its output. A brush is used to describe the loack ground of a button or foreground of a next or to fill a particular shape - - > Brushes enable us to paint user interface objects with anything from simple so rid colors. As well as complete set of patterns and images
This is a simple brush and is used to change the background or foreground colors of controls - - > This is in general not used with 2D or 3D images
This is used to set or get the required color to the required object foreground or background
This is used to fill a single color within the graphic object we cannot fill two or more colors using solid color brush within the graphic object
<window> <Grid> <Rectangle width=”100” Horizontal alignment=”Top” Margin= <Rectangle.fill> <solid color Brush color = “eed”/> </rectangle.fill> </rectangles>
This is used to fill the colors or apply the colors to a graphic image àUsing liner gradient brush we can fill or apply two or more colors at once within the graphic object - - > Using linear gradient brush we can apply or fill the colors diagonally (or) horizontally (or) vertically This sub tag <Gradient stop> has two attributesàWe use a sub tag known as Gradient stop Within the linear gradient brush class - - > Color - - > offset
Property is used to mention a location upto where the color should be applied or filled <Gradient stop color= “blue” offset= “1.4”/>àIf, we want to fill 3 colors in a square then we use linear gradient brush like <Linear Gradient Brush> <Gradient stop color= “Red” Offset = “0.3”/> <Gradient stop color=”green” offset=”0.6”/> </linearGradient brush>
Start point = “0,0.5” End point = “0,1.0” like <Line as gradient brush start point= “0.0.5” End point =”0,1.0”/> <Gradient stop color = “Red” offset = “0.3”/> <Gradient stop color = “Green” offset = “0.6”/> <Gradient stop color = “Blue” Offset = “%.4%> </Linear Gradient brush> Eg With linear Gradient Brush Create a new window Go to source write the following code within the grid <Grid> <Rectangle Height=”100” width=”100”> <Rectangle Fill> <Linear gradient brush> <Gradient stop-color=”red” offset= “0.3”/> <Gradient stop-color=”green” Offset =”0.6”/> <Gradient stop color=”blue” offset =”1.0”/>
</Rectangle.fill> <Linear Gradient brush Start point = “0, 0.5” Endpoint = “0,1.0”/> <Gradient stop color = “orange” Offset = “0.3”/> <Gradient stop color= “green” Offset = “1.0”/> </Linear Gradient brush> </rectangle.fill> </Gird>
<Ellipse Height = “100” width = “100”> <linear gradient Brush> <Gradient stop
Create a new WPF apps
Create a new window
Go to xaml source
Write the following code
<Rectangle Height = ‘100”, width =”100”/> <rectangle.file> <Radial Gradient Brush> <Gradientstop color=”Red” offset = “0.3”/> <Gradientstop color=”Green” offset = “0.6”/> <Gradientstop color=”Blue” offset= “1.4”/> </Radial Gradient brush> </Rectangle.fill> </RECTANGLE>
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.