1
00:00:00,570 --> 00:00:05,430
Hi again, no, we start creating the functions for each button we have here.

2
00:00:05,700 --> 00:00:12,480
So the first function that we create is function for this button, which will convert through the PMG

3
00:00:12,480 --> 00:00:13,830
to DPG type.

4
00:00:14,130 --> 00:00:22,540
So here we have two for our program machine, which we which is this one for the little for the window.

5
00:00:23,010 --> 00:00:24,520
Now it is an empty window.

6
00:00:24,750 --> 00:00:25,930
Do nothing for the moment.

7
00:00:26,280 --> 00:00:29,520
Now we start creating the function for foresting.

8
00:00:29,700 --> 00:00:33,570
So he had the first thing that we have to do is to import libraries for.

9
00:00:33,810 --> 00:00:43,860
So here we have thrombotic into import file dialog because we have to to create the window that will

10
00:00:43,860 --> 00:00:50,760
ask us for the images, for the image that we want to create to convert sorry that we have to create

11
00:00:51,290 --> 00:00:54,050
to how we will work with the digital images.

12
00:00:54,360 --> 00:01:06,720
So we have to import lots from B and import image Teekay or image Teekay like this.

13
00:01:07,320 --> 00:01:11,910
Then the images image like this as image.

14
00:01:11,910 --> 00:01:18,290
You know, after we have imported these functions, we will start creating the stuff that we have created

15
00:01:18,300 --> 00:01:18,660
Sony.

16
00:01:18,690 --> 00:01:20,130
We have imported these libraries.

17
00:01:20,400 --> 00:01:22,180
We will start creating the function.

18
00:01:22,380 --> 00:01:27,170
So the first option, as I told you, will be about this button, which is being due to jpg.

19
00:01:27,180 --> 00:01:29,960
So we will put it here as they come on.

20
00:01:30,420 --> 00:01:31,200
So we have

21
00:01:34,050 --> 00:01:35,850
three command.

22
00:01:36,750 --> 00:01:38,640
What I am doing command equal.

23
00:01:38,640 --> 00:01:46,850
I will call it, for example, being to the B.G. You know, this is our function.

24
00:01:46,890 --> 00:01:47,190
I will.

25
00:01:47,550 --> 00:01:50,340
And uppercase like this.

26
00:01:53,170 --> 00:01:54,670
Copy, control.

27
00:01:54,800 --> 00:02:12,630
See that we put it here, we have here to create the the function that will convert from the energy

28
00:02:12,640 --> 00:02:14,860
to GBG like this.

29
00:02:14,920 --> 00:02:15,940
So here we have.

30
00:02:17,500 --> 00:02:20,390
And this one, the name of the function.

31
00:02:20,720 --> 00:02:22,020
No, no.

32
00:02:22,030 --> 00:02:29,200
What we have here, the first thing that we have to do is to create a file dialog that will ask us to

33
00:02:29,200 --> 00:02:31,850
choose the picture that we want to convert.

34
00:02:32,170 --> 00:02:38,470
So as we did before we realized it, just like this, here we have roots and that file name.

35
00:02:40,780 --> 00:02:54,340
Like this dynamic world here, we have fine dialogue that I ask, but open now here, the first thing

36
00:02:54,340 --> 00:02:58,660
that we have to do is the title of the window title Equal.

37
00:02:59,470 --> 00:03:02,080
I will like this.

38
00:03:02,080 --> 00:03:06,730
I will put it choose a picture you can't with anything you want.

39
00:03:07,150 --> 00:03:13,840
Now, the second thing is the file type file types.

40
00:03:13,840 --> 00:03:18,070
I forget who five types here we have equal.

41
00:03:18,310 --> 00:03:23,310
Now we will start, we have this parenthesis here.

42
00:03:23,320 --> 00:03:25,450
Then there is another parenthesis to select.

43
00:03:25,470 --> 00:03:29,290
We we will select the BND and second parameters.

44
00:03:29,300 --> 00:03:30,670
We take all types.

45
00:03:30,670 --> 00:03:33,420
If we want to see all your pictures, we will take it here.

46
00:03:33,730 --> 00:03:41,470
So the first thing here we have being done here come up and here we have everything.

47
00:03:41,800 --> 00:03:48,340
That being because we did this before this started, means everything, which means every name we we

48
00:03:48,340 --> 00:03:48,610
have.

49
00:03:48,850 --> 00:03:57,250
Just that being now, this is this that was the first the first time that we have here to put second,

50
00:03:57,250 --> 00:04:02,770
which is I would put it in all types then.

51
00:04:05,040 --> 00:04:14,250
What we have had come out and we had everything that everything but everything, now we have created

52
00:04:14,250 --> 00:04:18,220
this one to see if it works, will just like this.

53
00:04:18,390 --> 00:04:19,260
Click this button.

54
00:04:19,620 --> 00:04:22,650
As you can see, this is our window here.

55
00:04:22,650 --> 00:04:24,600
We have the title, Choose a Picture.

56
00:04:24,780 --> 00:04:28,350
And here we have pornified and we here all types.

57
00:04:28,770 --> 00:04:36,390
OK, now, after creating this, we have to if I want that, if I choose a picture, I would put it

58
00:04:36,390 --> 00:04:43,850
in in this in the frame, which is this one I want to be to put the picture chosen in this frame.

59
00:04:43,890 --> 00:04:52,320
So to do this before that we do this, we have to see if if the the part that we have to use if the

60
00:04:52,320 --> 00:04:57,480
user selected the picture, because if we don't select the picture, we don't have a bath of any picture.

61
00:04:57,480 --> 00:05:01,470
So we can't use it to open the picture and put it in the frame.

62
00:05:01,740 --> 00:05:04,230
So the first thing that you have to do is to make a condition.

63
00:05:04,260 --> 00:05:18,540
So if this box is different to an empty string, so if that filename doesn't equal an empty string in

64
00:05:18,540 --> 00:05:23,860
this case, we will put it in the frame as we don't put anything to don't have an error after.

65
00:05:24,180 --> 00:05:31,520
So if it is different to have this ring, in this case, we, the user have chosen a picture.

66
00:05:31,770 --> 00:05:35,300
So now we would put it in the in the frame.

67
00:05:35,910 --> 00:05:42,360
So I put it, for example, we make it being a picture equal.

68
00:05:42,720 --> 00:05:48,020
We have an image that open now inside this function.

69
00:05:48,270 --> 00:05:52,800
But again, we have to provide the birth of the picture that we want to open.

70
00:05:53,550 --> 00:06:00,090
And as you can see, we have here, that filename is the part of the function of the picture that we

71
00:06:00,090 --> 00:06:02,760
have chosen after after creating the window.

72
00:06:03,450 --> 00:06:08,520
So we have just to put this one copy that we put it here.

73
00:06:09,060 --> 00:06:10,710
So we will put this.

74
00:06:10,710 --> 00:06:17,400
But here this function open, which is in the image object, will open the picture for us now.

75
00:06:17,430 --> 00:06:19,290
After that, we have we will open it.

76
00:06:19,860 --> 00:06:25,770
The first thing that we have to do is we have to revise it before, because if we have a thousands of

77
00:06:25,770 --> 00:06:30,210
pictures, we don't we don't know if all the pictures has the same size.

78
00:06:30,480 --> 00:06:36,390
So to make it very clear and very clean work, we have to realize it in the same site.

79
00:06:36,540 --> 00:06:39,660
Any picture we have chosen, we have to decide it in the same place.

80
00:06:39,960 --> 00:06:46,680
So here we will change it as we will use the functional resize, which is included in the image object.

81
00:06:46,690 --> 00:06:52,650
So we will make it, for example, there are which is resize it being a picture.

82
00:06:53,130 --> 00:07:03,240
It will be a picture that resize, resize, and he will put the parameters.

83
00:07:03,240 --> 00:07:10,350
The first parameters, which is the width and height, will put it as the same thing of the frame that

84
00:07:10,350 --> 00:07:10,890
we have here.

85
00:07:11,370 --> 00:07:13,110
It's the frame.

86
00:07:13,710 --> 00:07:20,870
And here you you can see the frame has the width of 450 and height of 500.

87
00:07:21,180 --> 00:07:26,270
So we put it in the same thing here we have 450 by 500.

88
00:07:26,550 --> 00:07:34,500
And the second parameter that we have is the image that and the idea, as I told you, to, to delete

89
00:07:34,500 --> 00:07:41,550
all the ideas that we will have if we have no after that, we have decided now we will use the function

90
00:07:41,700 --> 00:07:44,470
which is included in the object image.

91
00:07:45,180 --> 00:07:47,060
After that, we will put it in the frame.

92
00:07:47,520 --> 00:07:54,270
Now we call it, for example, a picture equals here we have what is it?

93
00:07:55,230 --> 00:07:58,950
Image, image.

94
00:08:00,480 --> 00:08:03,490
This one, that photo image.

95
00:08:04,110 --> 00:08:06,630
Now here we will put the picture that we have, resize it.

96
00:08:06,870 --> 00:08:14,340
So our big picture now, if we want to put the picture in the frame, we have first put it in the label.

97
00:08:14,340 --> 00:08:16,530
After that, we will put the label in frame.

98
00:08:16,870 --> 00:08:22,040
So here we have we will create a label, which is, I will call it live equal.

99
00:08:22,800 --> 00:08:34,270
Here we have the function like this on the label and here we will put it in the not in the in the frame

100
00:08:34,290 --> 00:08:38,870
sorry was in the frame because we want that the picture will take the place of the frame.

101
00:08:39,390 --> 00:08:43,770
So here we have frame then the what will I do.

102
00:08:43,770 --> 00:08:46,360
I think that this is that all we don't.

103
00:08:46,620 --> 00:08:46,970
Sorry.

104
00:08:47,130 --> 00:08:50,670
We have to make the image and here we have a picture.

105
00:08:52,710 --> 00:08:57,060
OK, now we have just to put this label.

106
00:08:57,070 --> 00:09:00,750
So label that back as you see.

107
00:09:01,770 --> 00:09:02,670
You will see that.

108
00:09:02,670 --> 00:09:03,390
We can see the.

109
00:09:03,640 --> 00:09:07,020
For the moment, because we have learned something, I hope that you got it.

110
00:09:07,060 --> 00:09:09,260
You can see that there is no picture here.

111
00:09:09,280 --> 00:09:09,620
Why?

112
00:09:10,120 --> 00:09:16,360
Because I told you that if we have a picture in the function, but we want to put it in the main road,

113
00:09:16,390 --> 00:09:19,740
we have to put this picture as a global variable.

114
00:09:20,020 --> 00:09:23,530
So we have here just to write a global

115
00:09:26,230 --> 00:09:26,700
picture.

116
00:09:26,770 --> 00:09:29,080
Now, it will work as we did before.

117
00:09:29,440 --> 00:09:30,820
We have here to select it.

118
00:09:31,270 --> 00:09:32,870
Here we have our picture.

119
00:09:33,160 --> 00:09:41,680
So if we really know, if we stop it and run it, you can see that if we press here, it will open this

120
00:09:41,920 --> 00:09:43,380
window for us we have here.

121
00:09:44,230 --> 00:09:48,080
So if I take this one, it will open for us.

122
00:09:48,400 --> 00:09:56,470
So here in this video, we have done this little like this, some lines to open the picture and recite

123
00:09:56,470 --> 00:10:03,890
it and convert it to make it ready for the frame, not to frame for it, for our tickets are up.

124
00:10:04,180 --> 00:10:09,700
So and this in this line, we have created Laybourne that we have put in the image in this label that

125
00:10:09,700 --> 00:10:15,310
we have put labor in the next video, we will start converting the picture and save it.
