Texnik tizimlarda axborot texnologiylari


Na’muna:Yuqoridagi qragik operatorlardan foydalanib, sodda tasvirlar hosil qiling. Dastur loyihasi uchun


Download 4.65 Mb.
bet102/167
Sana17.10.2023
Hajmi4.65 Mb.
#1705369
1   ...   98   99   100   101   102   103   104   105   ...   167
Bog'liq
atjmm

Na’muna:Yuqoridagi qragik operatorlardan foydalanib, sodda tasvirlar hosil qiling.
Dastur loyihasi uchun:
Forma oynasiga 1 ta Image, 5 ta Button (Shakl turini tanlash uchun) qo’yiladi. Har bir shakl turining Click hodisasi uchun quyidagi proseduradan foydalanamiz:


void fastcall TForm1::Button1Click(TObject *Sender)
{
Image1->Canvas->Pen->Color=clBlue; // Uychaning tomi Image1->Canvas->Pen->Width=5;
Image1->Canvas->MoveTo(100,100); Image1->Canvas->LineTo(200,20); Image1->Canvas->LineTo(300,100); Image1->Canvas->LineTo(100,100);

}
//


void fastcall TForm1::Button2Click(TObject *Sender)


{
Image1->Canvas->Pen->Color=clRed; // asosiy tana qismi Image1->Canvas->Pen->Width=5;
Image1->Canvas->Brush->Color=clYellow; Image1->Canvas->Rectangle(115,100,285,300);

}
// void fastcall TForm1::Button3Click(TObject *Sender)


{
Image1->Canvas->Pen->Color=clRed; // Eshiklar Image1->Canvas->Pen->Width=3;
Image1->Canvas->Brush->Color=clPurple; Image1->Canvas->Rectangle(170,230,200,300); Image1->Canvas->Rectangle(200,230,230,300); Image1->Canvas->Pen->Width=10;
}
// void fastcall TForm1::Button4Click(TObject *Sender)
{
Image1->Canvas->Font->Size=20; // Matn Image1->Canvas->Font->Color=clGreen; Image1->Canvas->Brush->Color=clSilver;
Image1->Canvas->TextOut(350,20,"Mening dasturim");
}
// void fastcall TForm1::Button5Click(TObject *Sender)
{
Image1->Canvas->Pen->Color=clPurple; // Gulcha va bargi Image1->Canvas->Pen->Width=5;
Image1->Canvas->Ellipse(400,200,450,250); Image1->Canvas->Ellipse(450,200,500,250); Image1->Canvas->Ellipse(425,160,475,210); Image1->Canvas->Pen->Color=clGreen; Image1->Canvas->Pen->Width=5;
Image1->Canvas->MoveTo(450,225); Image1->Canvas->LineTo(450,300);
Image1->Canvas->Ellipse(420,265,450,275); Image1->Canvas->Ellipse(450,265,480,275);
}
Natija olish uchun barcha buttonlar ketma-ket tanlanadi.




    1. Download 4.65 Mb.

      Do'stlaringiz bilan baham:
1   ...   98   99   100   101   102   103   104   105   ...   167




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling