Canvas->Brush->Color=clGreen;
Canvas->Rectangle(120,140,200,200);
}
//----------------------------------------------------------
26-rasm. Dastur natisaida olinadigan tasvir.
2-misol: O‘zbekiston respublikasining davlat bayrog‘ini chizish.
Formaga Button1 komponentasini o‘rnatib uni «Chizish» deb nomlaymiz va
Button2 komponentasini o‘rnatib uni «Chiqish» nomlaymiz. Bu komponentalar
uchun dastur kodini quyidagi ko‘rinishda yozamiz:
#include
#pragma hdrstop
#include "Unit1.h"
//------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//--------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Canvas->Pen->Color = clBlue;
Canvas->Brush->Color = clBlue;
Canvas->Rectangle(70,50,600,150);
// oy chizish
Canvas->Pen->Color = clBlue;
Canvas->Brush->Color = clWhite;
Canvas->Ellipse(80,55,170,145);
Canvas->Pen->Color = clBlue;
Canvas->Brush->Color = clBlue;
Canvas->Ellipse(105,55,195,145);
//yulduz chizish
Canvas->Font->Name = "Monotype Corsiva";
Do'stlaringiz bilan baham: |