Hello In this lecture we are going to add a picture directory that will include the pictures or images
we want to be displayed in our screen saver.
We'll also be implementing some code I have already added My Big Show directory.
I'm just gonna show you how to do that so you click on Start.
Go to documents Visual Studio usually stalls.
This project in your documents directory so click on Visual Studio click on projects click on the name
of your project as my project click on the project name again click on the bean directory click on debug
and thus the you should have a directory called picks.
Make sure you your directory is named the same way and inside you just have a list.
I've got a list of images it doesn't matter.
You can have a few you can have many doesn't really matter.
What's important is that you have an image called a directory called picks in that project.
Direct in that project area.
OK.
It must be within the being and in the tick in the debug section.
Make sure inside the bin directory and then the debug directory.
You've got a directory.
Court picks that will include your pictures.
So this will be the pictures that the screen saver will be referencing the code you'll be writing for.
This project will help you later on which your skills.
And you can apply that code to other stuff as well.
So click on the form design and the two ways you can do that.
You can either double click what one can achieve I want to see the code behind the phone Visual Studio
generates kind of like his skeletal code so you can either double click or you can go view and select
code or select F seven.
I'm just going to select code.
You can also do F seven if you wish.
And that will give you the code behind the form.
This was the event handler we generated in our previous lecture that will enable you to close the screen
once you press any key on your keyboard.
So what we are going to do we are going to create a couple of variables.
So I added some code here.
This is the code I have added.
Make sure you add it just both this public partial class.
Make sure it is between this curly braces and this public firm src a C saver so what does he have created.
Two variables.
Line 15 here is it will store is a variable that hose and every one of them will be an array of pictures.
Okay.
And the second one on line sixteen will be an array or Brit pick objects.
Notice there's some squiggly lines because this class here I've not defined the class yet.
So that's why we use to do is complain.
I'm gonna define the class in a minute.
So but this to a list basically is a kind of an array.
Okay so I've got two arrays here one is gonna store the images and the other is gonna store the print
pick objects.
All right.
The this brick pick is a special data type and it's going to hold a position for each picture in our
screensaver.
But I'm gonna define that class shortly.
Also I have used a random object here and given the name round we're going to use this to generate random
numbers.
So a given it equals to a new new creates a new instance of it new Random.
Okay.
So that's this bit of the code.
Just know that the first line here this will store an array of pictures.
The second we store an array of Brit pick objects.
Some added some more code I have now created that class.
So this is what I've just added.
I've created the class Brit pic so you can see the squiggly lines gone now.
In Visual Studio if you're not sure what the code does just place your mouse over it.
And the tool tip will give you a guide.
He says he tells you that you just put your mouse over it and it will tell you what that code does.
So I created a class called it Brit pig.
This is a special data type this brick pig is going to hold the position for each picture in our screen
saver.
I've also declared several variables here within this breed pig class.
So they are public.
I means they can be accessed from any parts of the code.
And the first one the data type is an integer.
I've given it a name of Pick number.
Second it is a float data type.
It tells you float represents a single precision floating point number and given it the value of x the
same data type here.
Float again given a variable of Y another float data type.
And I've given it a name of speed so we'll be using these variables later on in the project.
That's set for this project.
Sorry.
That's it for this lecture not the project will progress in the next lecture.
Thanks for watching.
Bye for now.