Nazorat savollari:
1. Delphida dastur tuzilmasi qanday?
2. Kiritish operatori haqida gapiring.
3. Chiqarish operatori haqida gapiring.
4. Shartli o’tish operatori qanday bo’ladi?
23-ma’ruza
“Futbol to’pini sakratish” loyihasi: Image komponenti
Reja:
1. Fayllar bilan ishlash
2. Funksiya va protsedura tushunchasi
3. Image komponenti
Rasmga matn joylash. Rasmlar bilan ishlashda ko‘p uchraydigan
amallardan biri bu rasmga matn joylashdir. Bu amalni bajarish uchun
Canvasning usuli bo‘lgan TextOut (matn chiqarish) dan foydalaniladi. Uning
uchta argumenti bo‘lib, ulardan dastlabki ikkitasi matn chiqariladigan sohaning
chap yuqori burchagining koordinatalari, uchinchisi esa ekranga chiqariladigan
matn satri. Bu operatorlarni qo‘llash bilan tanishish uchun quyidagi ilovani
yaratamiz. Unga Image va Button tugmalarini joylab, tugmani ikki marta
bosamiz va quyida ko‘rsatilgan operatorlarni kiritamiz:
Image1.Canvas.Font.Size:=8;
Image1.Canvas.TextOut(10,20, '8');
Image1.Canvas.Font.Size:=14;
Image1.Canvas.Font.Color:=clRed;
Image1.Canvas.TextOut(20,20, '14');
Image1.Canvas.Font.Size:=20;
Image1.Canvas.Font.Color:=clBlue;
Image1.Canvas.TextOut(40,20, '20');
Image1.Canvas.Font.Name:='Times New Roman';
Image1.Canvas.Font.Size:=30;
Image1.Canvas.Font.Color:=clGreen;
Image1.Canvas.TextOut(70,20, '30');
Image1.Canvas.Font.Size:=40;
Image1.Canvas.Font.Color:=clBlack;
Image1.Canvas.TextOut(110,20, '40');
Image1.Canvas.Font.Size:=50;
Image1.Canvas.Font.Color:=RGB(255,0,255);
Do'stlaringiz bilan baham: |