C # development Wpf/silverlight animation and games series Tutorials (Game Course): (31)

Source: Internet
Author: User
Tags silverlight

C # development Wpf/silverlight animation and games series Tutorials (Game Course): (31) Super Cool million vector magic

Remember that year's classic online games Miracle (MU)? Brilliance is as deep in my mind as its name. The days of fighting all night with my friends have become a thing of the past, leaving me with a memorable picture of the classic immortality of the world. Its success not only because it has a great world view, but also the deeper is those cool and gorgeous magic effect, once touched countless young hearts.

In this section, I'm going to show you how to make vector magic, modelled on the "laser" magic of the Marvel:

Do not know if this map can salvage the memories of the precipitation, this is the miracle of the same as the hell fire, one of the two great Magic: laser, beautiful picture and more importantly, it has a straight line penetration group attack effect. To imitate it, we can make a mock sketch from PS to learn the color and the gradual change of the magic picture, which will provide a reference for us to construct it later in Wpf/silverlight:

Using the gradient tool in PS to cooperate with the outer glow effect, we can easily create the above sketch, and then recall the previous content is not difficult to analyze in WPF we can draw a rounded rectangle and with a rainbow brush, and finally this rectangle to add a bitmap external light-emitting effect can achieve the above results. With the principle, it's easy to describe it in a XAML language. We first add a user control named Qxlaser to the project, and then set its XAML interface container code as follows:

……

<Canvas>

 <Rectangle x:Name="Body" Width="700" Height="80" RadiusX="80" RadiusY="80">

  <Rectangle.RenderTransform>

   <RotateTransform x:Name="Rotate" />

  </Rectangle.RenderTransform>

  <Rectangle.BitmapEffect>

   <OuterGlowBitmapEffect x:Name="Outer" GlowSize="40" Noise="0" Opacity="1" />

  </Rectangle.BitmapEffect>

 </Rectangle>

</Canvas>

……

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.