SIGN UP MEMBER LOGIN:    
ARTICLE

Creating art using Silverlight and Blend

Posted by Mamta M Articles | Silverlight with C# November 05, 2008
This article shows how you can draw attractive shapes and artistic elements using Silverlight and Blend.
Reader Level:

If you thought Silverlight 2 and Blend could only be used to create user interfaces, you couldn't be wrong. While the real use of Silverlight is, of course, for rich Internet applications, you could also design some swanky Web pages with it displaying only creative shapes and curves. Take a look at the image shown in Figure 1.



Figure 1. Creating Art using Silverlight and Blend.

Could you believe that this was created in Expression Blend 2 as a Silverlight 2 application with very little effort and hardly any coding? Yes, it's true. Let's see how you can do this.

The first step is to create a new Silverlight application in Expression Blend. Assume that you name this application as CreativeShape. Figure 2 shows the New Project dialog box.



Figure 2. New Project dialog box.

Once the project has been created, use the Pen tool from the Toolbox to draw a random shape. Figure 3 shows how the Pen tool looks in the Toolbox.



Figure 3.

Let us assume that you have drawn a shape similar to that shown in Figure 4.



Figure 4. Drawing a shape using Pen tool.

Then, select the shape drawn using the Selection tool from the Toolbox (it's present at the topmost left corner).

Now, open the Properties window using Window-> Properties.



Figure 5. Selecting the shape and opening Properties window.

Next, you set the Brush properties as shown in Figure 6.



Figure 6. Setting the Brushes properties

Make sure that you have chosen GradientBrush option.

Save the project, build and execute it. This can be done using the options on the Project menu.

When the application executes, you will see the output similar to that shown earlier in Figure 1.

Thus, you have created an attractive shape filled with color using minimal effort and no coding at all!

Let your imagination run riot with the Pen tool and the various options presented by the Brushes properties. You can also experiment with the Stroke and StrokeThickness options to create various effects for the shape.

Take a look at some fancy shapes created using the Pen tool and colored using the Brushes properties:



Figure 7. Abstract Shapes

Happy Creating !!!

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor