Sunteți pe pagina 1din 4

Ministerul Educaiei, Tineretului i Sportului al Republicii Moldova

Universitate Tehnic a Moldovei


Catedra ATI

Lucrarea de lab. nr.1


Disciplina: Grafica pe calculator

Tema: Sintezarea figurilor grafice

A realizat:

st. gr. TI-132

A verificat:

Rusu Cristin
L. Rotaru

Chiinu 2015

Scopul lucrrii: Obinerea cunotinelor practice n sinteza figurilor i suprafetelor


n baza bibliotecii grafice a oricrui limbaj de programare
(Pascal, C++, ori Java)
Sarcina lucrrii:
1. De a sinteza figuri grafice - linii; poligoane; curbe; suprafee: poligonale,
circulare, eleptice, sectoare de cerc i de elipse, mrginite de contur. Figurile
sintezate s fie descrise
2. De a salva i restaura imagini n/din fisiere
3. De a prezenta imagini n diferite pori de vizualizare
Listingul programului:
//font
Canvas->Brush->Color=clBlue;
TPoint P[4];
P[0].x=0;
P[0].y=0;
P[1].x=1350;
P[1].y=0;
P[2].x=1350;
P[2].y=273;
P[3].x=0;
P[3].y=250;
Form1->Canvas->Polygon(P,3);
Canvas->Brush->Color=clGreen;
TPoint T[4];
T[0].x=0;
T[0].y=250;
T[1].x=1350;
T[1].y=273;
T[2].x=1350;
T[2].y=560;
T[3].x=0;
T[3].y=560;
Form1->Canvas->Polygon(T,3);
//cer
Canvas->Brush->Color=clYellow;
Canvas->Ellipse(990,80,1080,170);
Canvas->Brush->Color=clGray;
Canvas->Ellipse(182,76,332,116);
Canvas->Ellipse(318,70,487,135);
Canvas->Ellipse(496,95,697,154);

//casa
Canvas->Rectangle(95,315,305,445);
Canvas->Brush->Color=clBlack;
TPoint R[3];
R[0].x=95;
R[0].y=315;
R[1].x=305;
R[1].y=315;
R[2].x=200;
R[2].y=270;
Form1->Canvas->Polygon(R,2);
Canvas->Brush->Color=clWhite;
Canvas->Rectangle(150,350,200,400);
Canvas->Brush->Color=clRed;
Canvas->Ellipse(100+500,200+145,200+500,300+145);
Canvas->Ellipse(300+500,200+145,400+500,300+145);
Canvas->Ellipse(255+500,230+145,295+500,270+145);
Canvas->Brush->Color=clYellow;
Canvas->Ellipse(340+500,240+145,360+500,260+145);
Canvas->MoveTo(150+500, 250+145);
Canvas->LineTo(170+500, 180+145);
Canvas->LineTo(200+500, 180+145);
Canvas->MoveTo(165+500, 190+145);
Canvas->LineTo(275+500, 250+145);
Canvas->LineTo(350+500, 250+145);
Canvas->MoveTo(275+500, 250+145);
Canvas->LineTo(290+500, 190+145);
Canvas->MoveTo(275+500, 190+145);
Canvas->LineTo(305+500, 190+145);
Canvas->MoveTo(275+500, 270+145);
Canvas->LineTo(350+500, 260+145);
Canvas->MoveTo(275+500, 230+145);
Canvas->LineTo(350+500, 240+145);
Canvas->Brush->Color=clSilver;
Canvas->Rectangle(940,270,1152,327);
Canvas->Brush->Color=clBlack;
Canvas->Rectangle(1045,327,1056,489);
Canvas->Brush->Color=clSilver;
Form1->Canvas->Font->Size=16;
Canvas->TextOutA(1000,290,"No acces");
}

Rezultate: