linkedin facebook linkedin facebook nod32

PaskalABC da grafik shakllar yasash

Muallif: Faxriddinov Sh.

Qo`shilgan sana: 2015-01-21

PaskalABC da grafik shakllar yasash

Bu qismda siz grafik shakllar va ularni ifodalovchi protseduralar bilan yaqindan tanishib chiqasiz.

3.1 SetPixel(x,y,color: integer);
program grafik3_1;
//Maqsad: (x,y) koordinatali pikselni rangga bo'yaydi
// SetPixel(x,y,color: integer);
uses graphABC;
var x,y:integer;
begin
setwindowsize(408,208);
centerwindow;
for x:=0 to 100 do
for y:=0 to 50 do
setpixel(4*x,4*y,x*10+y*1000)
end.

3.2 GetPixel(x,y): integer;
  program grafik3_2;
//Maqsad: (x,y) koordinatali piksel aniqlab uni butun son
// sifatida qaytaradi
//  GetPixel(x,y): integer;
uses graphABC;
var x:integer;
begin
setwindowsize(408,208);
centerwindow;
for x:=1 to 200 do
setpixel(2*x,x,getpixel(2*x-2,x-1)+1000);
end.

3.3 MoveTo(x,y: integer)
program grafik3_3;
//Maqsad: Ko'rinmas qalamni (x,y) koordinatali nuqtaga o'tkazadi
// LineTo(x,y) ham xuddi shunday vazifani bajaradi
// MoveTo(x,y: integer)
uses graphABC;
var x:integer;
begin
setwindowsize(450,450);
centerwindow; moveto(80,80);
lineto(160,160);lineto(240,240);
lineto(320,320) 

end.

3.4 LineTo(x,y: integer);
program grafik3_4;
//Maqsad: Qalam joriy holatini (x,y) koordinatagacha surib
//chiziq chizadi
//  LineTo(x,y: integer);
uses graphABC;
var x:integer;
begin
setwindowsize(400,400);
centerwindow;
moveto(75,75);
lineto(150,75);
lineto(75,150);
lineto(150,150)
end.

3.5 Line(x1,y1,x2,y2: integer);
program grafik3_5;
//Maqsad: Uchlari (x1,y1) va (x2,y2) nuqtalarda
//bo'lgan kesma chizadi
//  Line(x1,y1,x2,y2: integer);
uses graphABC;
var x:integer;
begin
setwindowsize(400,400);
centerwindow;
line(120,120,320,120);
line(320,120,120,320);
line(120,320,320,320);
line(175,225,270,250)
end.

3.6 Circle(x,y,r: integer)
 program grafik3_6;
//Maqsad: Markazi (x,y) koordinatada bo'lgan va radiusi r ga
//teng bo'lgan aylana chizish
//  Circle(x,y,r: integer)
uses graphABC;
var x:integer;
begin
//Oyna o'lchami
setwindowsize(300,300);
centerwindow;
for x:=50 downto 0 do
circle(220,220,x*4);
END.

3.7 Ellipse(x1,y1,x2,y2: integer)
  program grafik3_7;
//Maqsad:Qarama-qarshi uchlari (x1,y1) va (x2,y2)
//nuqtalarda bo'lgan to'g'ri
//to'rtburchakka ichki joylashgan ellips chizadi
// Ellipse(x1,y1,x2,y2: integer)
uses graphABC;
var x:integer;
begin
setwindowsize(420,420);
centerwindow;
for x:=35 downto 0 do
ellipse(200-x*10,0+x*10,200+x*10,400-x*10);
end.

3.8 Rectangle(x1,y1,x2,y2: integer);
program grafik3_8;
//Maqsad:Qarama qarshi uchlari (x1,y1) va (x2,y2) koordinatalarda bo'lgan  to'g'ri to'rtburchak chizadi
// Rectangle(x1,y1,x2,y2: integer);
uses graphABC;
var x:integer;
begin
setwindowsize(375,375);
centerwindow;
for x:=50 downto 0 do
rectangle(100,100,300,300);
end.

3.9 RoundRect(x1,y1,x2,y2,w,h: integer);
  program grafik3_9;
//Maqsad:Uchlari yumaloqlangan to'g'ri to'rtburchak chizadi
//(x1,y1) (x2,y2) koordinatalarda m va n esa uchlari
//yumaloqlashda ishlatiladigan ellips kengligi va balandligi
// RoundRect(x1,y1,x2,y2,w,h: integer);
uses graphABC;
var x:integer;
begin
setwindowsize(420,420);
centerwindow;
for x:=25 downto 0 do
roundrect(200-x*4,200- x*4,200+x*4,200+x*4,6*x,2*x);
end.

3.10 Arc(x,y,r,a1,a2: integer);
program grafik3_10;
//Maqsad:Markazi (x,y) va radiusi r ga teng bo'lgan hamda m1 va m2 markaziy
//burchaklar orasida joylashgan aylana yoyini chizadi.Biz kiritayotgan burchaklar ixtiyoriy
//soat miliga teskari o'lchanadi
//   Arc(x,y,r,a1,a2: integer);
uses graphABC;
var x:integer;
begin
setwindowsize(400,400);
centerwindow;
for x:=45 downto 1 do
Arc(200+(x mod 2)*4,200,4*x,180*(x-1),180*x);
end.

3.11 Pie(x,y,r,a1,a2: integer);
  program grafik3_11;
//Maqsad: Markazi(x,y) nuqtada radiusi r ga teng bo'lgan hamda m1 va m2 markaziy
//burchaklar orasioda joylashgan sektor chizadi
// Pie(x,y,r,a1,a2: integer);
uses graphABC;
var x:integer;
begin
setwindowsize(400,400);
centerwindow;
for x:=20 downto 1 do
pie(160-x*8,240+x*8,20*x,0,90);
end.

3.12 Chord(x,y,r,a1,a2: integer)
//Maqsad: Markazi (x,y) radiusi r hamda m1 va m2 gradusli markaziy burchaklar orasida
//joylashgan doira segmentini chizadi
// Chord(x,y,r,a1,a2: integer) program grafik3_12;
uses graphABC;
var x:integer;
begin
setwindowsize(400,400);
centerwindow;
//Takrorlanishlar 20 marta
for x:=20 downto 1 do
pie(100+5*x,200,10*x,30,330);
end.

3.13 FloodFill(x,y,color: integer);
program grafik3_13;
//Maqsad: (x,y) nuqtadan boshlab biror bir chiziq bilan chegaralangan sohani
//biror rangga bo'yash
// FloodFill(x,y,color: integer);
uses graphABC;
var x:integer;
begin
setwindowsize(400,400);
centerwindow;
for x:=20 downto 1 do
begin
pie(100+5*x,200,10*x,30,330);
FloodFill(100+4*x,200,255500+x*10);
end;

end.

3.14 FillRect(x1,y1,x2,y2: integer)
program grafik3_14;
//Maqsad: Qarama qarshi uchlari (x1,y1) va (x2,y2) bo'lgan to'rtburchakni
//joriy rangga bo'yaydi
//  FillRect(x1,y1,x2,y2: integer)
uses graphABC;
var x,y:integer;
begin
//Darcha o'lchami
setwindowsize(400,400);
//Darcha markazi
centerwindow;
floodfill(100,100,0);
//TakrorlanishlaR
for x:=0 to 7 do
for y:=0 to 7 do
//SHart operatori
if (x+y) mod 2=0 then
fillrect(x*50,y*50,50+x*50,50+50*y)
end.

733 marta o`qildi.

Foydalanuvchi ismi: Maxtumquli 101-guruh
Qo`shilgan sana: 2015-04-09

yaxshi

Foydalanuvchi ismi: Maxtumquli 101-guruh
Qo`shilgan sana: 2015-04-09

yaxshi

Foydalanuvchi ismi: Maxtumquli 101-guruh
Qo`shilgan sana: 2015-04-09

yaxshi

Foydalanuvchi ismi: Nizomiddin 203 guruh
Qo`shilgan sana: 2015-04-18

yaxshi

Parol:
Eslab qolish.


Ro`yhatdan o`tish

testing

+998915878681

Siz o`z maxsulotingizni 3D reklama ko`rinishda bo`lishini xohlaysizmi? Unda xamkorlik qilamiz.

3D Reklama

testing

masalalar.zn.uz/

Turli xil mavzuda, internet mavzular, faqat masalalar.zn.uz saytda.


Рейтинг@Mail.ru
Рейтинг@Mail.ru

Besucherzahler
счетчик посещений