Ishdan maqsad: Borland C++ Builder6 ning asosiy grafik imkoniyatlari bilan tanishish. Topshiriqlar


Download 36.09 Kb.
Pdf ko'rish
bet4/5
Sana16.06.2023
Hajmi36.09 Kb.
#1502743
1   2   3   4   5
Bog'liq
7-laboratoriya

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"; 

Download 36.09 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5




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