6-mavzu. Grafik ob’yektlarda klasslar va usullar bilan ishlash. Integrallashgan muhitda mavjud bo’lgan ma’lumotlar bazasini qayta ishlash. Reja


Bo’yash va chizish usullari hamda stillari haqida


Download 0.56 Mb.
bet11/20
Sana09.01.2022
Hajmi0.56 Mb.
#264741
1   ...   7   8   9   10   11   12   13   14   ...   20
Bog'liq
2 5384405580494408548

Bo’yash va chizish usullari hamda stillari haqida

1. setfillstyle (style, color) - buyash usul va rangni urnatish. Bu erda style - uzgarmas kattalik bulib, u kuyidagicha bulishi mumkin: 0 - soxani fon rangi bilan tuldirish; 1- soxani rang bilan uzluksiz tuldirish;


2 - kalik gorizontal chiziklar 3 - ingichka ogma chiziklar 4 - yugon ogma chiziklar 5 - yugon ogma chiziklar (boshka stil) 6 - ogma yullar 7 - turtburchakli chiziklar 8 - ogma turtburchaklar 9 - zich ogma shrtixlar 10 - siyrak nuktalar (u er - bu erda) 11 - zich nuktalar bilan 2. floodfill (x, y, color) - joriy rang va usuldan foydalangan xolda chegaralangan soxani buyash. Bu erda x va y - shu soxaga tegishli bulgan biror nukta koordinatasi. Avval rang, keyin stili kursatiladi. Masalan: setcolor (4); {kizil rangli kalam, chegara rangi} setfillstyle (1, 2); {1-stil bilan yashil rang bilan buyash} circle (50, 50, 35); {radusi 35 bulgan aylana chizish} floodfill (50, 50, 4); {aylana ichiga rang tukish, buyaladigan chegara rangi rangli kalam bilan bir xil bulishi kerak} 3. setlinestyle (s, a, b) – turli stildagi chiziklarni chizish uchun; Bu erda s- style nomeri; a –foydalanuvchi stilini yaratishi mumkin bulgan parametr, odatda a=1 deb olinadi; b- chizikning kalinligini kursatadigan parametr 0 – oddiy chizik; 1 – mayda punktir chizik; 2 – kalin va uzunchok punktir chizik 3 – yupka va uzunchok punktir chizik; 4 – siyrak nuktali chizik. 1- Misol:
# include

# include

void main ( )

{


int i, j, gd, gm;

gd= 0;


initgraph (&gd, &gm, " ");

setcolor (14);

// sarik kalam for ( i=0; i<=20; i++) for ( j=0; j<=20; j++)

circle (i*50, j*30, 55);

// sarik rangli aylanalar

rectangle (0, 0, getmaxx, getmaxy);

//ekran buylab tugri turtburchak

setcolor (11);

// tuk feruza rangli kalam

bar3d(200, 300, 100, 150, 30, topon);

// parallelopiped, ichi ok

setcolor (CYAN);

// och feruza rangli kalam

fillellipse (350, 360, 135, 90);

//ellips, ichi ok rangda

getch( );

closegraph( );

}
2-misol.

…….

void main ( )



{

gd=0;


initgraph (&gd, &gm, ' ');

setbkcolor (BLUE);

setcolor (14);

rectangle (120, 130, 240, 250);

setcolor (6);

line (120, 130, 180, 80);

setcolor (2);

line (180, 80, 240, 130);

setcolor (14);

rectangle (160, 160, 200, 250);

setcolor (4);

setfillstyle(7, 9);

circle( 300, 300, 50);

floodfill (300, 300, 4);

getch( );

closegraph ( );



}



Download 0.56 Mb.

Do'stlaringiz bilan baham:
1   ...   7   8   9   10   11   12   13   14   ...   20




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