Tile Brush In Silverlight 3 Application In Blend 3

No.of Views1007
Bookmarked0 times
Downloads 
Votes0
By  dpatra   On  08 Apr 2010 11:04:32
Tag : Silver Light and XAML , Skin And GUI
Every time you could have imagined for any background image for your application and for some controls. In Silverlight 2 and Silverlight 3 Beta it was not so easy to put Images as Background and do some Tiling. Using Tile Brush in Silverlight 3 we will be able to use images as background. In this article we will see how can we achieve that.
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

Every time you could have imagined for any background image for your application and for some controls. In Silverlight 2 and Silverlight 3 Beta it was not so easy to put Images as Background and do some Tiling. Using Tile Brush in Silverlight 3 we will be able to use images as background. In this article we will see how can we achieve that.

Creating Silverlight Project

Fire up Blend 3 and create a Silverlight Application. Name it as TileBrushInSL3.

 

Image Loading



1)    First thing we will do Image Brush is for the Grid (LayoutRoot).
2)    Select the Grid, go to the Properties Panel Choose the Brush Category and choose Tile Brush.
3)    Choose any Image (PNG or JPEG), and it’s done.

 

Image Loading

 

Image Loading

You can Stretch in of four types here:
•    None
•    Fill
•    Uniform
•    Uniform To Fill
Try out the above Stretch modes and you will get your best one match for your control.Now we will add some controls and see how Tile Brush is effected here.


4)    Add a TextBlock and do the same we did earlier steps and you will find something similar to the following.

Without Tile Brush
 

Image Loading

With Tile Brush

 

Image Loading

 

Isn’t that cool! I have just changed the Font Size of the TextBlock to look good.Suppose you have a List Box in your application do change the Background Brush to Tile Brush and it will look like below.
 

Image Loading

Similarly you can change your other Controls and their Brush to Tile Brush and play with it.
Enjoy Coding.
 

 
Sign Up to vote for this article
 
About Author
 
dpatra
Occupation-Not Provided
Company-Not Provided
Member Type-Expert
Location-Not Provided
Joined date-13 Jul 2009
Home Page-Not Provided
Blog Page-Not Provided
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top