Informatika va axborot
Ilovani ishga tushirib, uning ishini kuzating: 63-DARS
Download 4.2 Mb. Pdf ko'rish
|
10-sinf-informatika
4.5. Ilovani ishga tushirib, uning ishini kuzating:
63-DARS. RASMGA BOSHQA OBYEKTLARNI JOYLASH 1. Rasmga matn joylash. Rasmlar bilan ishlashda ko‘p uchraydigan amallardan biri bu rasmga matn joylashdir. Bu amalni bajarish uchun Canvas ning 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. Masalan, Image1.Canvas.TextOut(10,20, ‘Salom!’); operatori rasm sohasining (10, 20) nuqtasidan boshlab, ‘Salom!’ degan yozuvni chiqaradi. 145 Rasmga qo‘yiladigan yozuvning qanday shriftda chiqishini Canvas ning Font (shrift) nomli xossasidir. Masalan, shriftning o‘lchamini 14 qilish uchun Image1.Canvas.Font.Size:=14;, shrift rangini qizil qilish uchun Image1.Canvas.Font.Color:=clRed; operatoridan foydalaniladi. 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); Image1.Canvas.TextOut(180,20, '50'); Ilovani ishga tushirib, uning tugmasini bosamiz. Shriftni o‘zimiz bilgan Times New Roman ga almashtirganimizdan keyin ekrandagi math sifati yaxshilanganiga e’tibor bering. |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling