Add to Favorites    Make Home Page 3376 Online  
 Language Categories  
 Our Services  

Home » C Home » Games and Graphics Home » Screencloth design in graphics (Mini Project)

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Screencloth design in graphics (Mini Project)
Author Rajkumar.k
Author Email rajeni1 [at] rediffmail.com
Description This is a program which is not yet fully completed(95% completed) but it can work if you give the parameters correctly as the program asks and then see final image after you give all the details correctly.
Category C » Games and Graphics
Hits 365840
Code Select and Copy the Code
Code : #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> int main(void) { int gdriver = DETECT, gmode, errorcode; int s=1,n,t,x,y,w,po,d[40],c[40],i,j,h,k,r,m,a[40],p,q,g=0,b[40],l=0,u,*pt; char z; clrscr(); printf("Before you have to see this design you have to give the following details ");getch(); clrscr(); printf("choose from the below: "); printf("1--->customize your self "); switch(w) { /*cutomized design*/ case 1: printf("Give the number for increment of x-axis corresponding to the following list "); printf("Range of Numbers: 25 to 70 "); scanf("%d",&t); clrscr(); printf("Give the number for increment of y-axis corresponding to the following list "); printf("Range of Numbers: 25 to 70 "); scanf("%d",&u);clrscr(); printf("Give the number for Design color & back ground color corresponding to the following list "); printf("Range of Numbers: 1 to 15 "); printf("WHITE 01 BLUE 02 GREEN 03 CYAN 04 RED 05 "); printf("MAGENTA 06 BROWN 07 LIGHTGRAY 08 DARKGRAY 09 "); printf("LIGHTBLUE 10 LIGHTGREEN 11 LIGHTCYAN 12 LIGHTRED 13 "); printf("LIGHTMAGENTA 14 YELLOW 15 "); scanf("%d %d",&n,&po);clrscr(); printf("Give the number for Radius x-axis corresponding to the following list "); printf("Range of Numbers: 25 to 100 "); scanf("%d",&r);a[g]=t;b[g]=u;c[g]=n;d[g]=r; for(w=5;w>=1;w--) { a[w]=a[w-1]; b[w]=b[w-1]; c[w]=c[w-1]; d[w]=d[w-1]; }g++;break; /*presetted design*/ case 2: printf("Choose from the following presets. "); for(i=1;i<=5;i++) printf("%2d---->%2d %2d %2d %2d ",i,a[i],b[i],c[i],d[i]); scanf("%d",&i); t=a[i];u=b[i];n=c[i];r=d[i]; break; /* Fantacy design */ case 3:printf("Choose from the following fantacy. "); for(i=1;i<=1;i++) printf("%2d---->%2d %2d %2d %2d ",i,a[i],b[i],c[i],d[i]); scanf("%d",&i); t=a[i];u=b[i];n=c[i];r=d[i];break; } clrscr(); initgraph(&gdriver, &gmode, ""); errorcode = graphresult(); if (errorcode != grOk) { printf("Graphics error: %s ", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); } /*taking points*/ for(h=-100;h<=800;h+=t) { for(k=-100;k<=600;k+=u) { i=(h+r);j=(h-r);p=(k-r);q=(k+r);l=0; for(x=i;x>=j;x--) { for(y=p;y<=q;y++) { m=((x-h)*(x-h) + (y-k)*(y-k)); if(m==r*r) { switch(po) { case 1:setbkcolor(WHITE);break; case 2:setbkcolor(BLUE);break; case 3:setbkcolor(GREEN);break; case 4:setbkcolor(CYAN);break; case 5:setbkcolor(RED);break; case 6:setbkcolor(MAGENTA);break; case 7:setbkcolor(BROWN);break; case 8:setbkcolor(LIGHTGRAY);break; case 9:setbkcolor(DARKGRAY);break; case 10:setbkcolor(LIGHTBLUE);break; case 11:setbkcolor(LIGHTGREEN);break; case 12:setbkcolor(LIGHTCYAN);break; case 13:setbkcolor(LIGHTRED);break; case 14:setbkcolor(LIGHTMAGENTA);break; case 15:setbkcolor(YELLOW);break; } l++; switch(n) { case 1:setcolor(WHITE);break; case 2:setcolor(BLUE);break; case 3:setcolor(GREEN);break; case 4:setcolor(CYAN);break; case 5:setcolor(RED);break; case 6:setcolor(MAGENTA);break; case 7:setcolor(BROWN);break; case 8:setcolor(LIGHTGRAY);break; case 9:setcolor(DARKGRAY);break; case 10:setcolor(LIGHTBLUE);break; case 11:setcolor(LIGHTGREEN);break; case 12:setcolor(LIGHTCYAN);break; case 13:setcolor(LIGHTRED);break; case 14:setcolor(LIGHTMAGENTA);break; case 15:setcolor(YELLOW);break; } circle(x,y,r); } } } } } getch(); closegraph(); /* printf("Are you satisfied with this design. (please give y/n) "); scanf("%c",&z); pt=&s; if(z=='y') { a1[1]=t;b1[1]=u;c1[1]=n;d1[q]=r; printf("Your configuration is stored "); }*/ return(0); }

Related Source Codes

Script Name Author
The Game Opposite as seen on Nokia 2300 Mobile Manikanta
RECURSIVE BALANCED QUICK SORT ashish
Radix Sort ashish
Change your mouse pointer Ashim
The blinking star Shashank
Data Validation Crylittlebaby
To search a file by giving file type like mp3 or mpeg or doc Prashanth SR
Menus Demonstration B.Chidhambaram
Employee Database Project Using C. Reenku Raman Nayak
Creating a Lexical Analyzer in c fahad bader al-buhairi ¦Õ¤ ?¤Ð Ãß??ÝÐÝ
Calendar Program Omkar & Devendra
Stop double Process for start in C Cedrik Jurak
Stop double Process for start in C Cedrik Jurak
Time Scheduler Atiq Anwar
A timepass game between atmost two players Rahul Roy

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=907


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review