0
1
00:00:04,890 --> 00:00:06,350
<v Narrator>In this lecture we are going to learn</v>
1

2
00:00:06,350 --> 00:00:09,200
how we can use images for our applications.
2

3
00:00:09,200 --> 00:00:11,119
To do that what we need to do,
3

4
00:00:11,119 --> 00:00:14,120
firstly I want to create a specific location
4

5
00:00:14,120 --> 00:00:15,180
for my image, okay?
5

6
00:00:15,180 --> 00:00:16,520
Here what I will do,
6

7
00:00:16,520 --> 00:00:18,950
I will create a directory for my image first,
7

8
00:00:18,950 --> 00:00:22,110
and here I will come and right-click New.
8

9
00:00:22,110 --> 00:00:24,080
I will click Directory,
9

10
00:00:24,080 --> 00:00:26,260
and here I will name icons.
10

11
00:00:26,260 --> 00:00:27,910
Okay, this is my folder name,
11

12
00:00:27,910 --> 00:00:30,866
and after that here I will paste my image,
12

13
00:00:30,866 --> 00:00:35,783
and here my image name is icon.png okay?
13

14
00:00:35,783 --> 00:00:38,304
You can use any image you want.
14

15
00:00:38,304 --> 00:00:39,790
It doesn't matter.
15

16
00:00:39,790 --> 00:00:41,080
Here, what you need to do,
16

17
00:00:41,080 --> 00:00:43,950
and this is our template is already here.
17

18
00:00:43,950 --> 00:00:45,749
I create our template.
18

19
00:00:45,749 --> 00:00:47,900
I will create two labels, okay.
19

20
00:00:47,900 --> 00:00:50,070
The first one is, it will be a text.
20

21
00:00:50,070 --> 00:00:51,010
The second one is,
21

22
00:00:51,010 --> 00:00:53,580
I will use this label for my image, okay?
22

23
00:00:53,580 --> 00:00:57,353
to do t what i need to do I will say here lbl_text okay?
23

24
00:00:58,340 --> 00:01:01,770
And I will of course label constructors method,
24

25
00:01:01,770 --> 00:01:03,793
and the first parameter is root,
25

26
00:01:04,810 --> 00:01:07,150
and the second one is my text property,
26

27
00:01:07,150 --> 00:01:12,150
for text property I will say Using Images, okay
27

28
00:01:12,300 --> 00:01:14,510
and also I want to use font,
28

29
00:01:14,510 --> 00:01:16,864
font is equal to,
29

30
00:01:16,864 --> 00:01:21,690
for the font family name I will use Times,
30

31
00:01:21,690 --> 00:01:25,420
and for the font size I will use 18, okay.
31

32
00:01:25,420 --> 00:01:28,680
Now what I need to do I need to use pack geometry manager
32

33
00:01:28,680 --> 00:01:31,620
for my lbl_text, I will use pack
33

34
00:01:32,910 --> 00:01:35,591
and after that here now I will create my image,
34

35
00:01:35,591 --> 00:01:37,720
I will name it logo, okay,
35

36
00:01:37,720 --> 00:01:39,670
and after here what I need to do,
36

37
00:01:39,670 --> 00:01:43,436
I need to use PhotoImage constructor method, okay,
37

38
00:01:43,436 --> 00:01:46,440
and here with these parameters what I need to do,
38

39
00:01:46,440 --> 00:01:50,250
I need to pass in file is equal to,
39

40
00:01:50,250 --> 00:01:53,120
this will be my directory name okay, for my image.
40

41
00:01:53,120 --> 00:01:55,160
My directory name is here right,
41

42
00:01:55,160 --> 00:01:58,240
icons slash icon.png, okay,
42

43
00:01:58,240 --> 00:01:59,620
this must be correct,
43

44
00:01:59,620 --> 00:02:03,020
and here I will say my folder name is icons,
44

45
00:02:03,020 --> 00:02:04,670
if you don't use folder,
45

46
00:02:04,670 --> 00:02:07,770
you only give your image name, okay,
46

47
00:02:07,770 --> 00:02:10,170
for example here in this case,
47

48
00:02:10,170 --> 00:02:13,100
we can say icon.png here
48

49
00:02:13,100 --> 00:02:17,310
and I will say icon.png, okay.
49

50
00:02:17,310 --> 00:02:19,320
Now what is next, what I need to do,
50

51
00:02:19,320 --> 00:02:23,490
here I will create another label because labels,
51

52
00:02:23,490 --> 00:02:27,430
they can act as a container for images, okay,
52

53
00:02:27,430 --> 00:02:30,990
and we will store our image inside this label, okay,
53

54
00:02:30,990 --> 00:02:32,493
and I will name it lbl_image
54

55
00:02:34,690 --> 00:02:35,940
is equal to
55

56
00:02:36,840 --> 00:02:37,673
Label,
56

57
00:02:39,130 --> 00:02:41,510
and here I will paste in root
57

58
00:02:41,510 --> 00:02:45,330
and second parameter will be image is equal to,
58

59
00:02:45,330 --> 00:02:47,930
my image name is logo,
59

60
00:02:47,930 --> 00:02:50,180
my variable name is logo right,
60

61
00:02:50,180 --> 00:02:51,460
and after that here what I need to do,
61

62
00:02:51,460 --> 00:02:52,567
I need to say lbl_image.pack geometry manager
62

63
00:02:58,010 --> 00:02:59,950
and after here I need to use,
63

64
00:02:59,950 --> 00:03:03,500
actually is fine because you already used root.main loop.
64

65
00:03:03,500 --> 00:03:05,133
Now if I run my application.
65

66
00:03:07,340 --> 00:03:09,690
As you see now is here, our text is here,
66

67
00:03:09,690 --> 00:03:11,730
and also our image is here.
67

68
00:03:11,730 --> 00:03:14,200
This is how we can use images for our applications,
68

69
00:03:14,200 --> 00:03:16,343
for now that's all, see you in the next.
