Aylananing ichini bo‘yash dasturi
Download 21.17 Kb. Pdf ko'rish
|
- Bu sahifa navigatsiya:
- Natija: Misol
4-topshiriqlar Ranglarni dasturda quyidagi nomeri bo‘yicha berishimiz mumkin: Aylananing ichini bo‘yash dasturi #include #include main (){ initwindow(500,500); circle(150,150,50); setfillstyle(1,YELLOW); floodfill(150,150,WHITE); circle(280,150,50); setfillstyle(4,YELLOW); floodfill(280,150,WHITE); circle(420,150,50); setfillstyle(11,YELLOW); floodfill(420,150,WHITE); getch(); return 0;} Natija: Misol: Beze egri chiziqlari bilan berilgan shaklni soxasini bo‘yash (rang bеrish) algoritmidan foydalanib bo‘yash. #include #include #include #include float t; int i,s; void floodfill(int x,int y,char BorderColor,char NewColor) { if(getpixel(x,y)!=BorderColor) { if(getpixel(x,y)!=NewColor) { putpixel(x,y,NewColor); floodfill(x-1,y,BorderColor,NewColor); floodfill(x+1,y,BorderColor,NewColor); floodfill(x,y-1,BorderColor,NewColor); floodfill(x,y+1,BorderColor,NewColor); }}} int beze(int x1,int y1,int x2, int y2,int x3,int y3,int x4,int y4,float &X,float &Y) { for(i=0;i<1000;i++) { //delay(0); t=i/1000.; X=pow((1-t),3)*x1+3*t*(1-t)*(1-t)*x2+3*t*t*(1-t)*x3+t*t*t*x4; Y=pow((1-t),3)*y1+3*t*(1-t)*(1-t)*y2+3*t*t*(1-t)*y3+t*t*t*y4; putpixel(X,Y,s); }} int main() { initwindow (950,800); float X,Y; s=5; putpixel(400,525,WHITE); beze(278,288,150,220,320,125,310,278,X,Y); beze(310,278,330,125,500,260,327,300,X,Y); beze(327,300,475,275,390,440,310,322,X,Y); beze(310,322,400,425,190,440,278,310,X,Y); beze(278,310,170,430,150,220,278,288,X,Y); beze(310,322,500,500,175,550,200,700,X,Y); beze(234,600,290,530,400,525,500,575,X,Y); beze(500,575,475,525,500,500,328,500,X,Y); floodfill(301,309,s,RED); floodfill(400,525,s,GREEN); getch(); closegraph(); return 0; } 1. Kapalaklar bor katta bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 2. Moshinalar harakati katta yo‘l rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 3. Gullar bilan o‘ralgan katta bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 4. Lolalar joylashgan katta bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 5. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 6. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 7. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 8. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 9. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 10. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 11. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 12. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 13. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 14. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 15. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 16. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 17. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 18. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 19. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. 20. Ixtiyoriy mеvali daraxt + bog‘ rasmini bеzе egri chizig‘idan foydalanib chizing va soxani bo‘yash algoritmlaridan foydalanib rasmni bo‘yang. Download 21.17 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling