linkedin facebook linkedin facebook nod32

PaskalABC da rasmlar ustida amallar

Muallif: Faxriddinov Sh.

Qo`shilgan sana: 2015-01-21

PaskalABC da rasmlar ustida amallar

Bu qismda siz  rasmlar va rasmlar ustida bajariladigan har-xil ishlar bilan yaqindan tanishib chiqamiz

7.1 LoadPicture(name: string): integer
Rasmlar bilan ishlash uchun 6 ta protsedura va 4 ta funksiya mavjud
program grafik7_1;
//7-bob.RASMLAR USTIDA AMALLAR
// LoadPicture(name: string): integer
//name faylida joylangan  rasmni kompyuter xotirasiga
 yuklaydi va uning tartib raqamini funksiya qiymati sifatida
// qaytaradi.Bunda rasm topilishi kerak
uses crt,graphABC;
var rasm:integer;
begin
rasm:=LoadPicture('d:/Gif/7.jpg');
writeln(rasm);
end.

7.2 DrawPicture(n,x,y: integer);
program grafik7_2;
//  DrawPicture(n,x,y: integer);
//n rasmni ekranning (x,y) koordinatali joyidan
 boshlab chiqaradi
uses graphABC;
var rasm:integer;
begin
setwindowCaption('Informatika va AT');
rasm:=LoadPicture('d:/Gif/1.jpg');
drawpicture(rasm,5,5);
end.

7.3 DestroyPicture(n: integer);
program grafik7_3;
// DestroyPicture(n: integer);
//n raqamli rasmni xotiradan o'chirib tashlaydi va xotiraning bu qismidan
//boshqa maqsadlarda foydalanish mumkin ya'ni xotiradan o'chirilgan rasmdan
//foydalanish dastur ijrosi vaqtida xato yuzaga kelishi mumki
uses graphABC;
var rasm:integer;
begin
setwindowCaption('Dastur_7_7_2');
rasm:=LoadPicture('d:/pictures/brush4.bmp');
drawpicture(rasm,150,50);
DestroyPicture(rasm);
drawpicture(rasm,250,50);
end.

7.4 PictureWidth(n: integer): integer
program grafik7_4;
// PictureWidth(n: integer): integer
// n raqamli rasmning enini piksellarda qaytaradi
program grafik7_5;
//7-bob.RASMLAR USTIDA AMALLAR
//  PictureHeight(n: integer)
// n raqamli rasm bo'yini piksellarda qaytaradi
uses graphABC;
var rasm,r_bal,r_eni,i,j:integer;
begin
setwindowCaption('Qiy-chuv.uz');
rasm:=LoadPicture('d:/Gif/1.jpg');
r_eni:=Picturewidth(rasm); r_bal:=PictureHeight(rasm);
for i:=0 to 6 do   for j:=0 to 3 do
drawpicture(rasm,i*r_eni,j*r_bal);
end.

7.5 CreatePicture: integer;
program grafik7_6;
// CreatePicture: integer;
//yangi rasm yaratiladi va uning tartib raqamini funksiya qiymati sifatida qaytaradi
//odatda bu protsedura keyingisi bilan birga ishlatiladi

7.6 CopyToPicture(n: integer; r: Rect)
program grafik7_7;
// CopyToPicture(n: integer; r: Rect)
//r o'zgaruvchi bilan aniqlangan to'g'ri to'rtburchakdagi tasvirni tartib raqami
//n bo'lgan rasmga saqlab qo'yadi
uses crt,graphABC,PointRect;
var rasm,rasm1,r_bal,r_eni,i,j:integer;
r:rect;
begin
setwindowCaption('Jiddiy.uz');
rasm:=LoadPicture('d:/Gif/1.jpg');
r_eni:=Picturewidth(rasm);
r_bal:=PictureHeight(rasm);
for i:=0 to 2 do  for j:=0 to 1 do
drawpicture(rasm,i*r_eni,j*r_bal);
r:=rectf(0,0,3*r_eni,2*r_bal);
rasm1:=CreatePicture;
CopytoPicture(rasm1,r);
DrawPicture(rasm1,200,0);
end.

7.7 SavePicture(n: integer; fname: string);
program grafik7_8;
//SavePicture(n: integer; fname: string);
//tartib raqami n bo'lgan rasmni fname nomli faylga saqlab qo'yadi
uses graphABC,PointRect;
var rasm,rasm1,rasm2,r_bal,r_eni,i,j:integer;
r:rect;
begin
setwindowCaption('Jiddiy.uz');
rasm:=LoadPicture('d:/Gif/1.jpg');
r_eni:=Picturewidth(rasm);
r_bal:=PictureHeight(rasm);
for i:=0 to 2 do
for j:=0 to 1 do
drawpicture(rasm,i*r_eni,j*r_bal);
r:=rectf(0,0,3*r_eni,2*r_bal);
rasm1:=CreatePicture;
CopytoPicture(rasm1,r);
DrawPicture(rasm1,200,0);
savePicture(rasm1,'d:/Gif\2.jpg');
rasm2:=LoadPicture('d:/Gif\2.jpg');
DrawPicture(rasm2,100,100);
end.

7.8 SetPictureSize(n,w,h: integer);
program grafik7_9;
// SetPictureSize(n,w,h: integer);
//rasmning eni va balandligini w va h ga
// teng qilib o'rnatadi
uses graphABC,PointRect;
var rasm:integer;
begin
setwindowCaption('Jiddiy.uz');
rasm:=LoadPicture('d:/Gif/5.jpg');
setpicturesize(rasm,Picturewidth(rasm)div 2,PictureHeight(rasm)div 2);
DrawPicture(rasm,20,20);
end.

7.9 SetPictureTransparent(n: integer; b: boolean);
  program grafik7_10;
//  SetPictureTransparent(n: integer; b: boolean);
//tartib raqami n bo'lgan rasmni chiqarishda shaffof rang tartibini o'rnatadi
//(b=True) va (b=False)
uses graphABC,PointRect;
var rasm:integer;
begin
setwindowCaption('Jiddiy.uz');
rasm:=LoadPicture('d:/Gif/5.jpg');
FloodFill(1,1,$00ffff);
DrawPicture(rasm,10,10); //fon shaffof emas
SetPictureTransparent(rasm, true);
DrawPicture(rasm,110,10); //fon shaffof
SetPictureTransparent(rasm, false);
DrawPicture(rasm,210,10); //fon yana shaffof emas
end.

PaskalABC da ekranga chiqarish tartibi

Bu qismda siz yuqorida o’rgangan protseduralardan foydalanib ekranga chiqarish tartiblari bilan yaqindan tanishasiz

8.1 SetDrawingSurface(n: integer)
program grafik8_1;
//8-bob.EKRANGA CHIQARISH TARTIBI
//  SetDrawingSurface(n: integer)
//Ekranga chiqariladigan geometrik chiziq va shakllarni n raqamli rasmga yo'naltirish protsedurasi
//natijada tasvir ekranda emas rasmda paydo bo'ladi.
uses graphABc;
var rasm:integer;
begin
rasm:=1;
setpicturesize(rasm,200,200);
textout(20,10,'Tasvir ekranga yo''naltirilgan. ');
setdrawingsurface(rasm);
textout(20,40,'Tasvir rasmga yo''naltirilgan.');
end.

8.2. RestoreDrawingSurface;
program grafik8_2;
// RestoreDrawingSurface;
//Tasvirni rasmga yo'naltirishni bekor qiladi va chizish uchun ekrandagi grafik darcha
//tanlangan qalam,cho'tka va shrift parametrlarining tasvir rasmga yo'naltirilganigacha bo'lgan
//qiymatlari qayta tiklanadi
uses graphABc;
var rasm:integer;
begin
rasm:=createpicture;
setpicturesize(rasm,200,200);
setfontsize(12);
textout(20,10,'Tasvir ekranga yo''naltirilgan. ');
setdrawingsurface(rasm);
setFontcolor($0000ff);
textout(20,10,'Tasvir rasmga yo''naltirilgan.');
restoredrawingsurface;
drawpicture(rasm,0,40);
textout(20,90,'Tasvir yana ekranga yo''naltirilgan. ');
end.

8.3. LockDrawing;
  program grafik8_3;
// LockDrawing;
//ekrandagi grafik darchada chizishni to'xtatadi
// va tasvirni bufer xotiraga
//oladi.

8.4. UnlockDrawing;
program grafik8_4;
// UnlockDrawing;
//ekrandagi grafik darchaga tasvirni chizishga bo'lgan taqiqni bekor qiladi va
//tasvir yana grafik darchaga yo'naltiriladi
uses graphABc;
begin
setfontsize(12);
setfontcolor($0000ff);
textout(20,10,'Tasvir ekranga yo''naltirilgan. ');
lockdrawing;
textout(20,40,'Tasvir buferga yo''naltirilgan.');
unlockdrawing;
textout(20,70,'Tasvir yana ekranga yo''naltirilgan.');

end.

8.5. Redraw;
program grafik8_5;
//  Redraw;
//ekrandagi grafik darchaga chizish taqiqlangan paytda bufer xotiraga
//yo'naltirilgan tasvirni ekranga chiqaradi
uses graphABc;
begin
setfontsize(12);
setfontcolor($0000ff);
textout(20,10,'Tasvir ekranga yo''naltirilgan. ');
lockdrawing;
textout(20,40,'Tasvir buferga yo''naltirilgan.');
redraw;

end.

8.6. DrawingIsLocked: boolean;
program grafik8_6;
// DrawingIsLocked: boolean;
//grafik darchaga chizish taqiqlangan bo'lsa TRUE aks holda FALSE ni qaytaradi
uses graphABc;
procedure XabarOut;
begin
if DrawingIsLocked
then textout(20,10,'Tasvir ekranda')
else textout(20,40,'Tasvir buferda')
end;
begin
setfontsize(12);
setfontcolor($0000ff);
XabarOut;
lockdrawing;
XabarOut;
redraw;
end.

881 marta o`qildi.

Foydalanuvchi ismi: guzalbegim
Qo`shilgan sana: 2015-01-26

Маколага иллюстоация кушсангиз иаксадга мувовик булар эди!!" Javob: tushunmadim?

Foydalanuvchi ismi: 101-Hamidova O
Qo`shilgan sana: 2015-04-08

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


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

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