|
Va axborot texnologiyalari 10-sinf toshkent – 2021 Pdf ko'rish
|
bet | 99/153 | Sana | 19.05.2024 | Hajmi | 27,94 Mb. | | #244031 |
Bog'liq 10-sinf yangi
Figuraga rang berish
Ma’lumki, kompyuter monitori ekranidagi tasvirlar piksel deb nomlanuvchi kichik rangli
nuqtalardan iborat. Dasturda tasvir chizish uchun har bir piksel qaysi rangda bo‘lishini
kompyuterga “tushuntirish” lozim.
.........................
Yuqoridagi kodning davomi
draw.create_rectangle(30,30,200,250
fill='green',
outline='yellow')
Yuqori chap burchagi koordinatasi
(30,30), quyi o‘ng burchak koordinatasi
(200,250), rangi yashil, chegarasi sariq
to‘g‘ri to‘rtburchakni chizadi.
(30,30)
(200,250)
Python dasturlash tilida tkinter modulining figurali obyektlarni chizish uchun mo‘ljallangan bir
nechta funksiyalari mavjud.
Funksiya va tavsifi
Dasturdagi ko‘rinishi
Natijasi
create_line()
to‘g‘ri chiziq
c.create_line(10, 10, 190, 50)
create_polygon()
ixtiyoriy ko‘pburchak
A(100,10), B(20,90),
C(180,90)
c.create_polygon(100, 10, 20, 90,
180, 90)
create_polygon()
ixtiyoriy ko‘pburchak
A(20,10), B(140,10),
C(180,80) , C(10,80)
c.create_polygon(20, 10, 140, 10,
180, 80, 10, 80,
fill='pink',
outline='green')
create_rectangle()
to‘g‘ri to‘rtburchak
yuqori chap va quyi
o‘ng koordinatasi
berilgan.
c.create_rectangle(40, 40, 140, 80,
fill='yellow',
outline='green',
width=3,
activedash=(5, 4))
create_oval()
Aylana
Aylana bo‘lganligi
uchun kvadrat
koordinatasi beriladi.
c.create_ oval (50, 60, 150, 160,
width=2)
A
B
C
A
B
D
C
|
| |