Showing posts with label Property. Show all posts
Showing posts with label Property. Show all posts

Sunday, April 5, 2020

Windows Movie Maker

Aim:-

Learning about Windows Movie Maker Features and Components
Adding
Images/ Videos/ Audio
Transitions and Visual Effects
Title, Caption and credits
Editing Media Clips
Saving and Exporting a Movie

Where it can be found

Windows movie maker can be downloaded as a free part of Windows Live Essential services

Few of the services included in this package are : Mail, Messenger, Photo Gallery, Movie Maker, Writer, Family Safety and other web based services for e.g. outlook, one drive etc.

Features of Windows Movie Maker

It’s projects are automatically saved at a fixed time interval.
Allows to download music from online libraries.
Audio tracks can be extracted from video files.
Outline can be added on text elements.
It uses lower resolution video for previewing purpose.

Audio can be represented as a waveform.

How to start windows movie maker

Start
All programs
Movie maker

Components of Windows Movie Maker


Storyboard: this is used to arrange and manage the video clips, transition and visual effects that are applied to these clips in our project.
Preview Monitor Pane: this helps us to watch or preview our work as we work on the our project.
Rest components are same as other applications of windows which we have read in our previous classes.

For watching Video on components of Windows Movie maker please visit https://youtu.be/OvvM-10ppbM


Windows Movie Maker Add Images and Videos 

How to Add Images and Videos in Movie Maker

Left click on "Add videos and photos (button)"  in Add group of Home tab.
Add Videos and Photos Dialogue box appears, Select Desired Videos and Photos.
Click Open button [this will close this dialogue box and add the selected files in movie maker].
To Customize the look

You can either use Zoom in (+) or Zoom out (-) button on Zoom Slider Bar

OR

By Right Click on particular image or video and than use Zoom in (+) or Zoom out (-) option from the context menu.

To view the movie click play button on Movie control Panel

Windows Movie Maker Add Music

How to Add Music in Movie Maker

Left click on "Add music (button)"  in Add group

 of Home tab.

Contextual menu will appear as shown in Figure
First three options are for searching music online
And the last two options for adding music from our system.
Method is same for both options the only difference is when using add music at the current point will add music from the current location, while using Add music will add music to whole file.
Click on Add music from contextual menu.
Add music dialogue box will appear, select the music file you want to add to your movie.
Click Open button [this will close this dialogue box and add the selected files in movie maker].
Now a green bar will appear in the story board at the bottom of the clips and images this indicates that the audio file has been imported.
To view the movie and listen to the music click play button on Movie control Panel

Note:- if there was any voice in the clips than original voices will be replaced with the music which has been imported.


How to Add Narrations in Movie Maker

We can record our voice using microphone and add it as a sound track or narration in our video. Let’s see how

Make sure that you have already added few clips or videos in your movie. Now left click on Record narration (button)"  in Add group of Home tab.
A new Narration tab will appear .
Click Record button and start recording your voice.
Once you are done than click on Stop button.
Save narration dialogue box will appear save your voice and this will be added to the clip. Which will be displayed with a pink bar under the clips.
To view the movie and to listen to your narration click play button on Movie control Panel

For watching Video on adding Images, Videos , music and Narrations of Windows Movie maker please visit https://youtu.be/ol850iSZIEc
For Downloading Presentation please  visit  SlideShare

Saturday, November 13, 2010

Auto Implemented Properties


Auto Implemented Properties
In C# 3.0 and later, We have an easy, interesting way for declaring properties known as auto-implemented properties, These Auto implemented properties are especially used when there is no additional logic required in the property accessors. When a property is declared as using Auto Implementation as shown in the example below, compiler creates a private, anonymous backing field or you can say it a member which can be only accessed through the property's get and set accessors.

Example


The following example shows a simple class that has some auto-implemented properties:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AutoImplemented_Properties
{
    // This class is mutable. Its data can be modified from
    // outside the class.
    class Student
    {
        // Auto-Impl Properties for trivial get and set
        public double TotalMarks { get; set; }
        public string StudentName { get; set; }
        public int RollNo { get; set; }

        // Constructor
        public Student(double marks, string name, int Rno)
        {
            TotalMarks = marks;
            StudentName = name;
            RollNo = Rno;
        }
        // Methods
        public string GetStudentInfo()
        {
            return "Student Information : " + StudentName + " " + RollNo.ToString() + " " + TotalMarks.ToString();
        }
        public string GetMarks()
        {
            return "Marks : " + TotalMarks.ToString();
        }

        // .. Additional methods, events, etc.
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AutoImplemented_Properties
{
    class Program
    {
        static void Main(string[] args)
        {
            // Intialize a new object.
            Student Stud1 = new Student(987.50, "Meetu Choudhary", 90108);
            Console.WriteLine("Marks Before Modification");
            Console.WriteLine(Stud1.GetMarks());
            //Modify a property
            Stud1.TotalMarks += 499.99;
            Console.WriteLine("Marks After Modification");
            Console.WriteLine(Stud1.GetMarks());
            Console.WriteLine("Complete information of Student");
            Console.WriteLine(Stud1.GetStudentInfo());
            Console.ReadLine();
        }
    }
}

Output
Marks Before Modification
Marks : 987.5
Marks After Modification
Marks : 1487.49
Complete information of Student
Student Information : Meetu Choudhary 90108 1487.49


Code Discussion
  • Auto implemented properties are declared using the following line:
public double TotalMarks { get; set; }

·         Value of the property is increased by the object as  it is an Mutable class.

Stud1.TotalMarks += 499.99;

Note:
The class that is shown in the above example is mutable i.e. Client code has the power to change the values of objects after they are created. However, in complex classes that contain significant behavior (methods) and data, it might be a necessary to have public properties. but, for small classes or structs that may just encapsulate a set of values (data) with little or no behaviors (or Methods), it is recommended to make the objects which are immutable by declaring the set accessor as private. Attributes are permitted on auto-implemented properties but not on the backing fields as these fields are not accessible from our source code. If it is necessary to use an attribute on the backing field of a property, then just create a regular property instead of auto implemented property. For more information, see
How to: Implement a Lightweight Class with Auto-Implemented Properties 
To know about properties in C# read this article
For reading on Abstract Properties click here

Properties in C#


Today my friend asked me a question for which i provided a solution using properties of the class. but then he asked me what are these properties, why to use them and how to Implement them To answer these questions

Definition:
Properties are named members of classes, structs, and interfaces. They provide a flexible mechanism to read, write, or compute the values of private fields through accessors. or we can say Properties equip a class with a public way to expose its private members or to get and set values for those private members, while hiding implementation or verification code.
A property has two accessors
  • Get
  • Set

The get keyword
with the help of this keyword we can define an accessor method for a property or an indexer which retrieves the value of the property or the indexer element.
The Set Keyword
With the help of this keyword we can define which accessor is used to assign a new value to the property or indexer.
The value keyword is used to define the value being assigned by the set accessor. Properties which do not implement a set accessor are termed as read only Properties.

Let’s take the first example to demonstrate how to declare and use read/write properties.

Example 1
This sample shows a Car class that has two properties: Name (string) and Model (int). Both properties have read/write attributes.


//car.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
classCar
    {
privatestring CarName = "N/A";
privateint CarModelNo = 0;
// Declare a Name property of type string:
publicstring Name
        {
get
            {
//returns the Carname
return CarName;
            }
set
            {
//set the value od carname provided by the user
                CarName = value;
            }
        }
// Declare an Age property of type int:
publicint ModelNo
        {
get
            {
//returns the CarModelNo
return CarModelNo;
            }
set
            {
//sets the value for CarModelNo
                CarModelNo = value;
            }
        }
//Overriding the ToString function of the class for demonstration
publicoverridestring ToString()
        {
return"Name = " + Name + ", ModelNo = " + ModelNo;
        }
publicstaticvoid Main()
        {
Console.WriteLine("Simple Properties");
// Create a new Car object:
Car mycar = newCar();
// Print out the name and the modelno associated with the car:
Console.WriteLine("Car details - {0}", mycar);
// Set some values on the car object:
            mycar.Name = "Maurti";
            mycar.ModelNo = 1;
Console.WriteLine("Car details - {0}", mycar);
// Increment the modelno property:
            mycar.ModelNo += 1;
Console.WriteLine("Car details - {0}", mycar);
Console.Read();
        }

    }
}
Output
Simple Properties
Car details - Name = N/A, ModelNo = 0
Car details - Name = Maruti, ModelNo =
Person details - Name = Joe, ModelNo = 100

Code Discussion
  • Notice the way that the properties are declared, for example, consider the Name property:

publicstring Name
        {
get
            {
return CarName;
            }
set
            {
                              CarName = value;
            }
        }
  • After declaring the property Set and Get methods are contained inside the declaration. We can control a property is read/write, read-only, or write-only by controlling Get or Set methods. If we only include Get Method the property will be read only if only set method is used the property will be write only (Although very less scenarios I have seen this), and as in our example if both Get and Set are used that means property is read/write.
  • Once the properties are created or declared, they can be used as if they are the members of that class. The following statementssows both getting and setting the value of a property

mycar.Name = "Maurti";
mycar.ModelNo = 1;

  • If you have noticed that in a property’s Set method a special value variable is available which we have not declared anywhere. This variable contains the value that the user has specified, for example:

CarName = value;

  • You can see that these properties are used as other variables only see how we have incremented the ModelNo property

mycar.ModelNo += 1;

  • The ToString() method is overridden in this example:
publicoverridestring ToString()
        {
return"Name = " + Name + ", ModelNo = " + ModelNo;
}
Check that I have not used the ToString() explicitly. It is invoked by default by the WriteLine calls.


In my next article I will  discus Abstract Properties

you can read Properties in C# here

Subscribe via email

Enter your email address:

Delivered by FeedBurner

MSDotnetMentor

MSDotnetMentor My Website http://msdotnetmentor.com