Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; Type TForml =Color:=form 1. Color; forml.Canvas.Ellipse(x,y,x+10,y+10); x:=x+5; form1. Canvas. Pen. Color:=clBlack; forml.Canvas.Ellipse(x,y, x+10 |
Multiplikatsiya Grafik komponentalar
|
bet | 4/10 | Sana | 08.02.2024 | Hajmi | 35,63 Kb. | | #153462 |
Bog'liq Delphi tizimining oynasi va uning elementlariBu sahifa navigatsiya:
- Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; Type TForml =
- Color:=form 1. Color; forml.Canvas.Ellipse(x,y,x+10,y+10); x:=x+5; form1. Canvas. Pen. Color:=clBlack; forml.Canvas.Ellipse(x,y, x+10
Multiplikatsiya
Multiplikatsiya deyilganda harakatlanuvchi rasm tushuniladi. Rasmni harakatlantirish uchun avval u ekranga chiziladi, ma’lum vaqtdan so‘ng rasmni o‘chirib yangi joyga chiziladi.
Quyidagi dastur, aylananing chapdan o‘ngga harakatini ko‘rsatadi.
Harakatlanuvchi aylana dasturining formasi.
Harakatlanuvchi aylana dasturining matni:
Unit Unitl; interface uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls; Type
TForml = class(TForm) Timerl: TTimer;
procedure FormActivate(Sender: TObject); procedure TimerlTimer(Sender: TObject); private
{ Private declarations } public
{ Public declarations } end;
Procedure Ris; Var
Forml: TForml; x,y: byte;
implementation
{$R *.dfm}
Procedure Ris;
Begin form1. Canvas.Pen. Color:=form 1. Color; forml.Canvas.Ellipse(x,y,x+10,y+10); x:=x+5;
form1. Canvas. Pen. Color:=clBlack; forml.Canvas.Ellipse(x,y, x+10, y+10) ; end;
Procedure TForml.FormActivate(Sender: TObject);
Begin x:=0;
y:=10;
timerl.Interval:=50; end;
Procedure TForml.TimerlTimer(Sender: TObject); Begin
Ris; end; end.
Grafik komponentalar
Image komponentasi formaga rasmlarni joylashtirish uchun ishlatiladi. Joylashtirilishi lozim bo'lgan rasmlar bitli fayllar (kengaytmalari .Bmp), piktogrammali (kengaytmalari .Ico), metafayllar (kengaytmalari .wmf) bo’lishi kerak.
Image komponentasi Additional palitrasida joylashgan bo‘lib, u ko‘rinishdagi piktogrammaga ega. Bu tugmachani bosib formadan rasm uchun joy ajratiladi va keyin esa xossalar bo’limidan Picture xossasi tanlanib, u yerdan uch nuqtali tugmacha bosiladi. Natijada ekranda rasmni aniqlash va joylash uchun muloqot darchasi ochiladi.
Muloqot darchasi quyidagi tugmachalarga ega:
|
| |