Saturday, August 25, 2007

BOUNDARY-FILL algorithm in C

BOUNDARY-FILL algorithm in C

/*Graphics algorithm to impliment the BOUNDARY-FILL-4 Algorithm */


#include<dos.h>
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void drawpolygon(int n,int arr[][2],int color);
void boundfill4(int x,int y,int fill,int boundary);
void main()
{
int arr[10][2],n,x,y;
printf("Enter the number of edges : ");
scanf("%d",&n);
for(int i=0;i<n;i++)
{
printf("Enter the X and Y position for %d edge : ",i+1);
scanf("%d %d",&arr[i][0],&arr[i][1]);
}
printf("Enter X and Y co-ordinates of the point from where you want \n");
printf("to start BOUNDARY-FILL : ");
scanf("%d %d",&x,&y);
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
drawpolygon(n,arr,RED);
getch();
boundfill4(x,y,BLUE,RED);
getch();
closegraph();
restorecrtmode();
}
void drawpolygon(int n,int arr[][2],int color)
{
setcolor(color);
for(int i=0;i<n;i++)
{
if( i == n-1 )
line(arr[i][0],arr[i][1],arr[0][0],arr[0][1]);
else
line(arr[i][0],arr[i][1],arr[i+1][0],arr[i+1][1]);
}
}
void boundfill4(int x,int y,int fill,int boundary) //boundary=RED
{ //fill=BLUE
int current;
current = getpixel(x,y);
if( (current != boundary) && (current != fill) )
{
delay(2);
putpixel(x,y,fill);
boundfill4(x+1,y,fill,boundary);
boundfill4(x-1,y,fill,boundary);
boundfill4(x,y+1,fill,boundary);
boundfill4(x,y-1,fill,boundary);
}
}




/*Graphics algorithm to impliment the BOUNDARY-FILL-8 Algorithm */

#include<dos.h>
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void boundfill8(int x,int y,int fill,int boundary);
void main()
{
int r,x1,y1,x2,y2;
printf("Enter Left and Top co-ordinates to draw a SQUARE : ");
scanf("%d %d",&x1,&y1);
printf("Enter Right and Bottom co-ordinates to draw a SQUARE : ");
scanf("%d %d",&x2,&y2);

int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
setcolor(RED);
rectangle(x1,y1,x2,y2);
getch();
printf("Enter X and Y co-ordinates to Fill a circle using BOUNDRY-FILL : ");
scanf("%d %d",&x1,&y1);
boundfill8(x1,y1,BLUE,RED);
getch();
closegraph();
restorecrtmode();
}
void boundfill8(int x,int y,int fill,int boundary)
{
int current;
current = getpixel(x,y);
if( (current != boundary) && (current != fill) )
{

putpixel(x,y,fill);
delay(2);
boundfill8(x-1,y-1,fill,boundary);
boundfill8(x,y-1,fill,boundary);
boundfill8(x+1,y-1,fill,boundary);
boundfill8(x-1,y,fill,boundary);
boundfill8(x+1,y,fill,boundary);
boundfill8(x-1,y+1,fill,boundary);
boundfill8(x,y+1,fill,boundary);
boundfill8(x+1,y+1,fill,boundary);

}
}

59 comments:

Anonymous said...

for [URL=http://jacket-dresses.net/]moncler sale[/URL] at my estore XIsLtTJL [URL=http://jacket-dresses.net/ ] http://jacket-dresses.net/ [/URL]

Anonymous said...

you must read PRucarup [URL=http://www.uggs-outlet2013.com/]uggs outlet[/URL] , for special offer xFFTzRmH [URL=http://www.uggs-outlet2013.com/ ] http://www.uggs-outlet2013.com/ [/URL]

Anonymous said...

buy best vBXKNsuX [URL=http://www.burberry-outlet2013.com/]burberry coat[/URL] for promotion code IGcobaGY [URL=http://www.burberry-outlet2013.com/ ] http://www.burberry-outlet2013.com/ [/URL]

Anonymous said...

look at RFYyNyaf [URL=http://www.gucci-outlet2013.net/]gucci online[/URL] online shopping EdEkUqNj [URL=http://www.gucci-outlet2013.net/ ] http://www.gucci-outlet2013.net/ [/URL]

Anonymous said...

click ECZVaPUn [URL=http://www.moncler-outlet2013.org/]moncler coat[/URL] to get new coupon HXOaShUJ [URL=http://www.moncler-outlet2013.org/ ] http://www.moncler-outlet2013.org/ [/URL]

Anonymous said...

buy best VFSFskem [URL=http://www.moncler-outlet2013.org/]moncler boots[/URL] for promotion code aZZPtJzB [URL=http://www.moncler-outlet2013.org/ ] http://www.moncler-outlet2013.org/ [/URL]

Anonymous said...

ghd hair straightener kysqbltp ghd australia liczzvyk ghd hair straighteners kikwxccy

Anonymous said...

ghd hair straightener urxpxdcl ghd australia qcumdqet ghd hair straighteners jmyjmmkd

Anonymous said...

cheap ugg boots sale ipnuwiex cheap ugg boots uk wcoxkxjw cheap ugg boots dediyofg cheap uggs gluseveo ugg boots sale uk hqdswftx ugg boots sale dwjhblyb ugg boots uk okcrbyya ugg boots zdmcpdeb ugg sale wlqyewnm

Anonymous said...

bycjkxjwq www.louisvuittonluggageonline.com qbbqtnuqy [url=http://www.louisvuittonluggageonline.com]louis vuitton bags cheap[/url] bumualcmy
wwkjimack www.louisvuittononsaleshoes.com bqgepgklz [url=http://www.louisvuittononsaleshoes.com]louis vuitton outlet[/url] plxfarbnl
mqfekcgoh www.louisvuittononlineshoes.com blzthslzo [url=http://www.louisvuittononlineshoes.com]louis vuitton shoes[/url] twtlsjywz
pnhdzjhmi www.newdiscountlouisvuittonhandbags.com izmmorezu [url=http://www.newdiscountlouisvuittonhandbags.com]louis vuitton purse[/url] gxodqyssq
ajckcgibe www.newdiscountlouisvuittonhandbag.com ezeiiqleu [url=http://www.newdiscountlouisvuittonhandbag.com]louis vuitton handbags for sale[/url] czkqbhxuw

Anonymous said...

Every time that you just receives a commission, place 10% of your income, after taxes, in in your FUN account. It was usually disguised by blending a nominal rate of interest with loan issuing fees, cheque cashing fees, and unavoidable late payment penalties [url=http://onlinepaydayloans-4u.co.uk/]payday loans online[/url] aspect all with the expenses to the credit, specially when you can find needless costs apart from your curiosity. If you can pumpout 5-8 of those articles 1 hour you are able to make some a nice income. These loans, which could be availed and never have to pledge any collateral, understand approved presently pay day loans uk we all understand that texas is really a state recognized for courage. But for other people this short term fast solution could produce a long term problem if it is time to pay for the money back and also the borrower still won't have the money. Likewise, the blood of Jesus is ineffectual for wholeness, healing, deliverance, preservation, freedom and victory, Unless we appropriate it http://onlinepaydayloans-4u.co.uk/ gateway mortgage lending how awesome can it be which you are now able to sign up for payday cash advances online.

Anonymous said...

Αppreciatiоn tο mу father whο tоld mе about thiѕ webpage,
thiѕ weblog іs really remarkable.


My ωeb-site ... defans oyunları

Anonymous said...

of course likе youг web ѕite howeѵer уou neеd
to test the spellіng on sevеral of your posts.
Many of them are rife with spеlling issues аnd I to find it νery bοthersоme to tell
the truth hoωeveг I will surely cοme
back again.

Take а loоk at my ωeb site; ev oyunları

Anonymous said...

I treasured to hunting through and through these Graphic designer dress out In that respect are heaps of booths with tattoo and body art are influential Fashion center, completed the outfit. Topping Off the SummerTake one of a tragic confusedness which has a way storage with more designers are not familiar. The couple were snapped relaxing at the mettle true statement 2013 fashion design Exhibit - backstage NEW YORK, NY - February 10: knocker ASAP Rocky and DJ Jameela Jamil looks make out on trend and would honey. www.kaspersuitsshop.com/ [url=www.kaspersuitsshop.com]kasper plus size suits[/url] I didn't Create the right piece of fashion innovators, and maybe crouch it up to 70% OFF+ supernumerary 15% OFF with the colors which jibe theirwhole turnout. kasper pant suits kasper suits review kasper suits for women The to the highest degree exciting Component part about dog manner tips on how very much Christina Aguilera fat in this in a higher place Pic we see a definition for every discussion. The mode can be sold off too. Today the movement of fashion design Designers, Models, Magazines and new styles and slimming annulus �695 Net-A-Porter.

Anonymous said...

JvfShg [url=http://longchampbagsoutlet.devhub.com]longchamp hobo[/url] RdzWmk KerAsq [url=http://sacslongchampfrance.devhub.com]longchamp pas cher[/url] NmuAzc PwiDqe [url=http://guesswatches201.ucoz.co.uk]guess watches uk[/url] BhjJhk XuoQnx [url=http://burberryoutlet.ucoz.co.uk]sburberry outlet sale[/url] AyxGlf XpvCjj [url=http://longchampuk2013.ucoz.co.uk]longchamp 2013[/url] SwcUug
2013 Who Wants [url=http://michael-kors-sac-soldes.webnode.fr]sac a main michael kors[/url] To Know How You Can Get To The michael kors Top Rated Spot. [url=http://longchampsacsfr9.webnode.fr]sac longchamp le pliage[/url] Is Speaking About [url=http://longchampsacsfr.webnode.fr]longchamp sacs[/url] You Need To Review Or Be Left Out An Deadly Mix up Unveiled Around [url=http://isabelshoesale.ucoz.co.uk]isabel marant sale shoes[/url], sneakers And How To Protect against [url=http://sitemichaelkors.webnode.fr]sac michael kors 2013[/url], To MK In Step-By-Step Detail
LzfVjr [url=http://chaussuresisabellemarantprix.webstarts.com]chaussures isabelle marant[/url] EsvBvm IciNeo [url=http://sacguesssoldes.webstarts.com]guess soldes[/url] GjtYbd QliGyb [url=http://longchamppascherpliage.weebly.com]longchamp pas cher pliage[/url] QhaXft OylVqz [url=http://isabellemarantsneakersimitation.weebly.com]isabelle marant paris[/url] BvbKra WraYbj [url=http://sacmichaelkorssoldes.weebly.com]michael kors france[/url] OefRpn
YudBjz [url=http://isabellemarantcollection.devhub.com]isabelle marant en ligne[/url] BhxZnm AtiWss [url=http://longchampsoldes2013.devhub.com]longchamp pliage[/url] JplFsj JwxGvj [url=http://sacguesspascher2.webnode.fr]sacs Guess[/url] WjzPkb DawWjg [url=http://isabelmarantbottes7.webnode.fr]acheter bottes isabel marant[/url] TrrYtw LuhMmb [url=http://soldeslongchamppliage.webnode.fr]Sac Longchamp[/url] YnsNdr

Anonymous said...

The Reply is childlike: fashion video display racks. Jack Wills Fashion stores, with the reliable online serviceprovider at affordable prices. www.kasper-suits.net www.kasper-suits.net/ [url=www.kasper-suits.net/]kasper dresses[/url] [url=http://kasper-suits.net]kasper pant suits[/url] The line covers lots more attractive because you Require to live over the play from the Antonio Berardi Prove in Uruguay, 22-year-old Luisel Ramos suffered a good fashion design Give way Utmost nighttime. In ordering to Chance fashion and retail. kasper pant suits kasper womens suits How is it a conscious decision to avoid putting her pes a few Fashion Design tips and tricks that Countenance women to the camera, with disastrous results. This 'imperfection' is said that fashion and the other are respectable alternate to schematic clothing industry. He gives me a" Bonnie and Clyde" Take care, appeared on various programmes on telecasting shows, Fashion Design merchandising.

Anonymous said...

Nice post. I used to be checking continuously this weblog and I am impressed!
Extremely helpful information specially the closing
part :) I take care of such information a lot.
I was seeking this particular information for a very long time.
Thank you and best of luck.

Have a look at my web blog; the tao of badass

Anonymous said...

I like the valuable info you provide in your articles. I will bookmark your blog and check
again here frequently. I am quite certain I'll learn many new stuff right here! Good luck for the next!

My homepage; where can i buy the tao of badass

Anonymous said...

Hi there! Do you know if they make any plugins to help with Search Engine Optimization?
I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good gains.
If you know of any please share. Cheers!

my blog post - monster beats

Anonymous said...

Does your site have a contact page? I'm having problems locating it but, I'd like
to shoot you an email. I've got some creative ideas for your blog you might be interested in hearing. Either way, great site and I look forward to seeing it grow over time.

My blog ... ジョーダン

Anonymous said...

It's amazing in favor of me to have a website, which is helpful in support of my knowledge. thanks admin

Also visit my web blog - ジョーダン

Anonymous said...

Good day! This is kind of off topic but I need some guidance from
an established blog. Is it difficult to set up your own blog?
I'm not very techincal but I can figure things out pretty quick. I'm thinking about making my own
but I'm not sure where to start. Do you have any points or suggestions? Thank you

Feel free to surf to my website; monster ヘッドホン

Anonymous said...

Thank you for the good writeup. It in fact was a amusement account it.
Look advanced to more added agreeable from you! However,
how could we communicate?

Feel free to surf to my page ... ルブタン

Anonymous said...

I have read so many articles concerning the blogger lovers except this piece of writing is genuinely
a good post, keep it up.

Have a look at my blog post; ルブタン 店舗

Anonymous said...

I know this website offers quality dependent articles or reviews
and additional information, is there any other web page
which provides these kinds of data in quality?

my webpage; monster beats

Anonymous said...

always i used to read smaller articles or reviews
which as well clear their motive, and that is also happening with this article which I am reading at this time.


my web page :: wiki.ku.dk

Anonymous said...

Hello mates, how is all, and what you would like to say concerning this article,
in my view its genuinely awesome for me.

my site: ルブタン 店舗

Anonymous said...

Hello, all the time i used to check web site posts here in the early hours in the daylight, as i love to learn more and more.


Feel free to visit my weblog - ジョーダン

Anonymous said...

After I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and
from now on whenever a comment is added I get 4
emails with the same comment. Is there an easy method you can remove me from that service?
Many thanks!

my webpage www.monsterbeatssale-shop.com

Anonymous said...

I always spent my half an hour to read this
blog's content all the time along with a cup of coffee.

Also visit my web site - www.monsterbeatsoutlet-sales.com

Anonymous said...

Thanks for sharing your thoughts. I really appreciate your efforts and I am waiting for your next post thank you once again.


Check out my page: http://www.christianlouboutinoutletshopx.com/

Anonymous said...

Do you have a spam problem on this website; I also am a blogger,
and I was curious about your situation; we have developed some nice methods and we are looking to trade techniques with other
folks, be sure to shoot me an e-mail if interested.


Here is my weblog - naturalmath.com

Anonymous said...

Having read this I thought it was very informative.
I appreciate you taking the time and energy to put this content together.
I once again find myself personally spending a lot of
time both reading and posting comments. But so what, it was still worthwhile!


Here is my weblog :: クリスチャンルブタン靴

Anonymous said...

Very soon this web page will be famous amid all blogging and site-building users,
due to it's good articles

my blog post: http://www.emarginmodels.com/user/FinlayBern

Anonymous said...

Hurrah! After all I got a web site from where I know how
to actually get useful information concerning
my study and knowledge.

Feel free to visit my web-site ... エアジョーダン

Anonymous said...

My partner and I stumbled over here by a different page and thought I should check things out.
I like what I see so i am just following you. Look forward to exploring your web page repeatedly.


Look at my homepage :: ジョーダン

Anonymous said...

I appreciate, cause I found just what I was taking a look for.
You've ended my four day long hunt! God Bless you man. Have a nice day. Bye

Here is my homepage; クロエ アウトレット

Anonymous said...

Hi there! I'm at work surfing around your blog from my new iphone 4! Just wanted to say I love reading through your blog and look forward to all your posts! Carry on the great work!

Also visit my webpage ... エアジョーダン

Anonymous said...

Pretty! This was an incredibly wonderful article. Thanks for providing
these details.

My site: レイバン

Anonymous said...

It is perfect time to make some plans for
the future and it is time to be happy. I've read this post and if I could I desire to suggest you some interesting things or advice. Perhaps you can write next articles referring to this article. I wish to read even more things about it!

Here is my weblog - www.engerwitzdorf.gv.at

Anonymous said...

I comment each time I especially enjoy a post on a site or
I have something to contribute to the discussion.
It's triggered by the passion communicated in the post I browsed. And on this post "BOUNDARY-FILL algorithm in C". I was actually moved enough to drop a leave a responsea response :) I do have a few questions for you if it's allright.

Is it simply me or does it look like like some of these remarks come across as if
they are written by brain dead people? :-P And, if you are posting
on other sites, I would like to keep up with you.
Could you make a list every one of your communal pages like your twitter feed, Facebook page or linkedin profile?


Here is my web page - クロエ アウトレット

Anonymous said...

Everyone loves what you guys are up too. This type of clever work and coverage!

Keep up the excellent works guys I've incorporated you guys to blogroll.

Here is my web page; ジョーダン

Anonymous said...

Quality articles is the key to attract the visitors to
pay a quick visit the website, that's what this web site is providing.

Feel free to visit my weblog ... hotrod.mdowdell.com

Anonymous said...

Hi there, I enjoy reading all of your article post.

I wanted to write a little comment to support you.

Here is my web-site miu miu 財布

Anonymous said...

Definitely believe that which you said. Your favorite justification seemed to be on the net the simplest thing
to be aware of. I say to you, I definitely get irked while people consider worries that they just do not know about.
You managed to hit the nail upon the top and also defined out the whole thing without having side-effects ,
people could take a signal. Will likely be back to get more.

Thanks

Here is my page :: prada バッグ

Anonymous said...

Wow! This blog looks just like my old one!

It's on a totally different subject but it has pretty much the same layout and design. Outstanding choice of colors!

Also visit my blog post - トリーバーチ通販

Anonymous said...

Hey I know this is off topic but I was wondering if you knew of any widgets I
could add to my blog that automatically tweet my newest twitter updates.
I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

Also visit my weblog ... monster beats

Anonymous said...

It's awesome to go to see this web site and reading the views of all friends concerning this article, while I am also keen of getting knowledge.

my site - monster ヘッドホン

Anonymous said...

I got this web site from my pal who shared with me concerning this site and now this time I am browsing this web page and reading very
informative articles or reviews here.

my page; クロエ財布

Anonymous said...

I have to thank you for the efforts you've put in writing this blog. I'm hoping to view the
same high-grade blog posts by you in the future as well.
In fact, your creative writing abilities has motivated me to get my own, personal website now ;)

Visit my website http://dailyhowler.blogspot.com

Anonymous said...

Hello mates, its impressive paragraph regarding educationand entirely explained,
keep it up all the time.

My homepage :: アバクロンビー

Anonymous said...

I ԁon't know how you'νe managed tο get by fоr sο long.


My blog ... fast payday cash loan

Anonymous said...

So much for attemptіng this myself, Ι
ωon't be able to manage it. I'll just learn аbout it.



Alsο νіѕit my web-site; loans broker

Anonymous said...

I love to study thе detailѕ of thesе things, thаt's what makes this site really tick over. Things other people forget.

Also visit my web site ... fast cash loans uk

Anonymous said...

Оff for а ѕcаn on my fingегѕ soon, can bаrely tуpе ωith this break.

Has anyоne eνer tгied ωrіting ωith a fractured fingег!
?.

my webpage - fast cash personal loans

Anonymous said...

So - "BOUNDARY-FILL algorithm in C" - Ӏ wouldn't have thought it would be as good a read as it has been. Now I should really go and do some work.

Have a look at my web page - bad credit personal loans

Anonymous said...

I savor, lead to I found just what I used to be
having a look for. You've ended my 4 day lengthy hunt! God Bless you man. Have a great day. Bye

Feel free to visit my weblog: Michael Kors Handbags

Anonymous said...

Hey! I know this is kinda off topic however
I'd figured I'd ask. Would you be interested in exchanging links or maybe guest writing a blog post or
vice-versa? My site goes over a lot of the same subjects as yours and I believe we could greatly benefit from each other.
If you happen to be interested feel free to send me an e-mail.
I look forward to hearing from you! Awesome blog by the way!


Stop by my web site ... Justin Sather

crackstools said...


crackstools is a hub of software cracking tools including protection against the manipulation of software, serial number, hardware key, date checks etc. You can find full version software, activation keys,serial key, and license keys for lifetime, crack, patch, keygen in crackstools with easy download source.crackstools.com