JUMPSTART WITH ANIMATIONS IN BLEND 2015

March 29, 2016
6 mins read

The Animations designing in Microsoft Blend 2015 is very interesting and fun to do. Some Magical things happened when Objects move and animate.

Basically, there are two major animation techniques that are generally used. i.e. Frame-Based & Time-Based Animation.

In frame-based animation, the animation cut into frames and displayed one frame at a time. In old films, you might see that camera does this by recording many photographs (frames) per second, and, when it is played back, it feels like a moving picture. So it happened in a similar manner except that the frames can be further apart in time and the computer will animate and interpolate any changes in between. The problem with such kinds of animations is that they become resource intensive when they run.

In time-based animation, you define the start and end points of a visual transition, and the framework interpolates the property changes over time and displays the animation in our application. In UWP, the animation is time based, so don’t worry about frame based animation…

  • So Simply create a Blank Project in Microsoft Blend for Visual Studio;
2
  • Now Simply draw an Eclipse for Tool Bar and apply Gradients to it;
3
  • Now simply go to the ‘Objects and Timeline’ panel and click on the + button in the top-right corner of the panel, as shown in the following screenshot. This will add a storyboard into our application;
4
  • Now when will get a Popup to set the name of the Storyboard;
5

Simply name the Storyboard. Now when the Storyboard create, you will have the time line in the Objects and Timeline windows;

6

Now you can test the storyboard at the design time itself without having to run the application. When you select a storyboard, you see the playback controls on the Objects and Timeline panel. Let’s go through them one by one from left to right;

  • First frame: This moves the playhead to the first frame of the animation
  • Previous frame: This moves the playhead to the previous frame
  • Play: This plays the animation from the current point in time, that is, from the current position of the playhead.
  • Next frame: This moves the playhead to the next frame.
  • Last frame: This moves the playhead to the last frame.

If we select the storyboard and right-click on the animation name, we see multiple options in a popup. Each option in the popup is described in the following list;

7
  • New: This creates a new storyboard and asks for a name for it
  • Duplicate: This creates a new storyboard that is the same as the existing one
  • Reverse: This reverses the sequence and keyframes of the existing storyboard
  • Delete: This deletes the selected storyboard
  • Rename: This provides us with the option to rename the storyboard
  • Close: This closes the animation view and storyboard

Now if you see the Timeline, you can see the great view through each you can easily manage the Timeline;

8

Animations in Blend are composed of timelines recorded on keyframes that represent the timing of property changes.

Timelines provides a structure to the animation sequence in our apps. We can think of the timeline as a layer on which the property changes of the objects are applied. The three sections of a timeline are depicted in the following screenshot:

  • We can see the timeline inside the Objects and Timeline panel. At the top of the Timeline panel, we can see the various controls to play and seek the animation we are designing. The play button is enabled once we have added at least one animation timeframe.
  • In the second section, you can see the current playhead position, which is 0:00.000 when we created the storyboard. Also, the other two options next to this playhead position are snapping options. The format of the time displayed is MM:SS:xxx (minutes, seconds, milliseconds) of the currently selected point.
  • The third section that we see shows the visual representation of the playhead position, and we can drag it to the position we want.

The Properties Windows of Microsoft Blend also plays a major role with Story Board to manage Animations…

Moreover you can see the Keyframe in the Timeline.

9

A keyframe in an animation sets a specific state of an object. A sequence of keyframes defines the object’s movement that we see, and the position of a keyframe defines the object movement timing.

The first keyframe defines the starting of the animation and the next one determines how it’s going to proceed. By changing the surrounding keyframes, we can change the starting or ending point of the transition, depending on whether the keyframe is before or after the transition.

For example, we can set a keyframe at the 0-second mark, record the position of the ball in the top-left corner of the art board, and then set a keyframe at the 1-second mark to record the position of the same ball in the bottom-right corner of the art board. Now, the animation will move the ball from the top-left corner to the bottom-right corner in 1 second.

We can use these keyframes and the storyboard to change any property of the object, and these properties can be visible or invisible.

Basically there are four types of keyframes in Blend;

  • Object-level keyframes: These keyframes apply to the whole object (such as an ellipse or rectangle) or to the object that contains multiple objects (such as a grid or canvas). In the latter case, when we expand the object node, we can see the individual elements on which we have recorded the keyframe. As we can see in the image, we have set the keyframe on the ellipse. To record such a keyframe, we can click on an object, such as an ellipse or rectangle, and click on the Record Keyframe button.
  • Compound keyframes: These keyframes imply that the property has child properties being animated. To record such a keyframe, while still in the recording mode, change any of the compound properties of the object and link the translation and the keyframe will be automatically created.
  • Simple keyframes: These keyframes represent the property change of a single property. As illustrated in the screenshot, the X and Y properties are simple keyframes. To record such a keyframe, while still in the recording mode, change any of the simple properties of the object, and the keyframe will be automatically created.
  • Implicit keyframes: These keyframes are present when we move from one animation to another and the second animation does not have a keyframe at the 0-second mark. Blend animates the change from the last known value of the property to the first keyframe of the second animation. This last known value is known as the implicit keyframe even when this is the value between two keyframes in the first animation.

So! Let’s Design some animations to get hands on experience;

Select the ellipse and click on the Record Keyframe button, as shown in the next image. This will record the current state of the selected object. So, when we click on the Record Keyframe button, make sure that we select only relevant objects just as we selected the ellipse here.

A keyframe is responsible for changing the properties of an object. Once we click on the Record Keyframe button, we can see a white mark in front of the ellipse object as it is the object that was selected when we clicked on Record Keyframe. So, this keyframe has the value of all the properties of ellipse at the 0 sec mark;

10

So! That’s how we can easily insert a keyframe that is at the initial state for the animation to start.

Now to make some action, lets perform some transmission to the ball;

Simply move the playhead in the Timeline panel from the current position, that is, 0, to 1. Click on and drag the ellipse to the bottom-right corner of the art board. When we drag the ellipse, we will notice a few changes:

  • The play button is now enabled. When we click on it, we can see the animation playing. And, we see a highlighted white mark of the playhead in front of the ellipse. So, this keyframe saves all the properties of the ellipse at the 1 sec mark.
  • We also see a series of dots connecting the original position of the ellipse to the new position. This actually depicts the path that the ellipse will follow when the animation happens;
11

Now repeat the same step and take the Eclipse to its initial state;

12

Now simply click upon Storybard name in the Objects and Timeline Window. You’ll get ‘Common’ in properties Windows. Now simply change the RepeatBehavior to Forever;

13

So, we have figured out that storyboards are made up of structures called keyframes, and that these structures can be changed by specifying the time, property, and value.

Now simply go to Assets Windows and in Behaviors select the ControlStoryboardAction’ and drop into the Design surface.

14

And in the Properties Window, select the name of Storyboard in the Storyboard option;

15

Now when you run the project, you’ll see that the ball will bounce as expected…

16

Now some EeasingFunction, click upon Keyframe in Timeline. Now EasingFunction will appear in Easing Properties;

17

And simply select the number of bounces and bounciness;

18

Now when you run the Application, then the selected animations will work for you.

Further you can add further animations according to you your wish…

So! See how interesting is to play with animations…

FOR HANDS ON DEMO

In order to get a best hands-on experience along with the Blog. Try out the code either By MSDN Code Samples or By GitHub

Data Scientist & Solution Architect || IBM Recognised Speaker, Mentor, and Teacher || Debater || Blogger || Guinness World Record Holder || Watson Solution Developer || IBM Community Activist || Aspiring to Inspire.

Leave a Reply

Your email address will not be published.

Previous Story

DEVELOPING UWP APPS WITH SAMPLE DATA

Next Story

PENDULUM OSCILLATION WITH ANIMATIONS IN BLEND 2015

Latest from Blog

Quantum Computing | What, Why & How

Now as we are starting the 5th decade after the very first proposed model in the 1980s, quantum computers are now commercially available, brought out of the lab, and into the industry by IBM Quantum. With many experts predicting it will revolutionize the way we approach problem-solving. With the recent

Case Study: Digital Transformation of “justSajid Bank”

In this current era of what we call “digital first”, industries are repeatedly changing and evolving with the help of technology. So as the banking industry is reshaping itself, banks need to keep adopting positive changes to counter and overcome the key challenges of the modern world to overcome the

Metaverse || A Whole New World.

Things are going to be super dramatic in the next few years. Metaverse is going to open a lot of new doors to revise things that we are doing now. The culture and lifestyle would be changed. Some new cultures would have emerged and everybody would be living without physical

Pakistan Day 2020 | Coronavirus Technical Solutions

Well, on Pakistan Day 2020 our nation along with the rest of the world is facing Corona Pandemic. As the sons of this great motherland, we are trying to play our roles at our places. Within the last few weeks, Alhamdulillah I’ve got a chance to develop two technical solutions

Password: Choose the Secure, Easy and Cool Password

A super secure Password is very common nowadays. Although according to experts the password is going to expire very soon. Moreover, the pin codes are also replacing password in some why. Perhaps still there is a lot of importance of a secure password in many places. The one of the most

JumpStart with DevOps

What is DevOps; DevOps is a Software Development Strategy, that bridges the gap between the Dev and the Ops side of the company. * It’s not a tool, it’s a Methodology to bridge the gap b/w development and operations teams! As there is always a lot of conflicts between the

JumpStart Programming with Python 3

Motivation; Well, if you want to play with data and deal with complex analytics problems then Python is the best for you. We can use Python for developing complex scientific and numeric apps. Python is designed with features to facilitate data analysis and visualization. The syntax in Python helps the programmers to do coding

Understanding of Data Science Methodology

Motivation: It’s all about the different methods used in data science. Data Science Methodology: There is the following methodology used in data science which can further categories into different phases; From Problem to Approach Business Understanding Analytical Approach Working with Data Data Requirements Data Collection Data Understanding Data Preparation Deriving the

Understanding Machine Learning Methodology

Motivation Well, if we talk about a human cell sample extracted from a patient. The cell would have some characteristics. One of the interesting questions we can ask, what kind of statistics that cell have? One could easily presume that only a doctor with years of experience could diagnose a tumor and

SIMPLE NAVIGATION IN WINDOWS APPLICATION

The Navigation of UWP Apps is extremely cool and easier than other platforms. It allows enabling a variety of intuitive user experiences for moving between apps, pages, and content. Navigation is the key part of the Application. In your small Apps, you may maintain your contents and functionality in a

UNDERSTANDING THE ARCHITECTURE OF UNIVERSAL WINDOWS PLATFORM

The architecture of Universal Windows Platform is most exclusive with the center of gravity which is One Windows Core. Now the whole development will follow the common refactored core that will common for all the windows Releases. It’s all about One Core, One Hardware Platform, Universal Hardware Driver and Standalone

Guinness World Record Holder | Hajj Hackathon | Khadim Al-Haramain Al-Sharifain

Khadim Al-Haramain Al-Sharifain Built an MVP of a cognitive platform name “Khadim Al-Haramain Al-Sharifain“.  Objective The objective was to facilitate Hajj operations by introducing cognitive services integrated with Hajj systems. Hence millions of Muslims who are there for Allah Rab-ul-Izat, can perform anything without disturbing their focuses and concentrations.  Functionalities

JumpStart with IBM Bluemix

IBM Bluemix is the world most exclusive cloud platform that provides developers to quickly develop, Deploy and manage Apps over the cloud without dealing with any underline infrastructure. Bluemix provides great open source platforms for your needs. Tech experts believe that up to 2020 the computing era would completely change.

JumpStart Into Big Data With HDInsight

What would happen when the volume of your data increased repeatedly over time and you need high velocity at the same time. Not only that but you have a different variety of data and Variability also exists in your data. So how would you handle all that data? If we

Microsoft SharePoint: Create an Intranet in SharePoint

As you should already have some hands on with SharePoint. So, Lets do some hands on with SharePoint Intranet for Small company. Simply start with a Blank Site Collection. Let’s assume that the company has 3 Departments: Sales, Production and Support. They each have their own area in which they should

.NET Core

.NET Core 1.0  .NET Core 1.0 is a major new investment in the future of .NET and laying the foundation for decades to come. Still, it is in its early stage, and for some time you might still focus .NET Framework 4.6 depending on your application needs. But for many scenarios,

JUMPSTART WITH DATA BINDING IN UWP

Data Binding is one of the most interesting topics in Universal App Development. In order to perform the better functionality, you really need to have some great usage of Data Binding in you Apps. So! First thing first. What is actually the Data Binding and is its usage in UWP.

justSajid | A PLACE FOR MY THOUGHTS

This blog is my personal mental playground. The views expressed are mine, and mine alone. They do not represent the views of my employer, my family, my friends, my imaginary friends, my neighbors, people who live in my city, province, country, region, or planet, nor do they represent the views

justSajid | A PLACE FOR MY THOUGHTS

justSajid is my personal mental playground. The views expressed are mine, and mine alone. They do not represent the views of my employer, my family, my friends, my imaginary friends, my neighbors, people who live in my city, province, country, region, or planet, nor do they represent the views of

Agentic AI: The Future of Machines Acting with Purpose

Artificial Intelligence (AI) has come a long way from being a fancy algorithm for chess games to becoming our digital assistant, creative collaborator, and even a philosopher’s muse. One of the more intriguing advancements in AI is Agentic AI—an AI system that can act autonomously, pursue goals, and make decisions,
GoUp