Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / fill tool in paint

Author
Message
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 2nd Dec 2005 07:15
i have created an awesome paint program and i want to know if there is some script i can use to make it so i can fill in one spot if its in between 2 lines. here is my code:


i know this is asking alot but i really need to know

Everyone starts a noob. so lets not laugh at our younger souls.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 2nd Dec 2005 10:44
I don't know what you mean by fill in one spot... but i'd like to introduce you to for/next loops.

Change this in your code:



To this:


Sorry if you already knew about for/next loops.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 2nd Dec 2005 11:56
Do a search in the codebase for IanM's floodfill routine.

Also if you search main DBPro forum there are loads of posts about 2D fill routines.

Boo!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Dec 2005 13:27
I notice that you are also trying to draw a filled circle - you can also find that in Codebase under '2D graphic commands'

For free Plug-ins and source code http://www.matrix1.demon.co.uk
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 2nd Dec 2005 16:27
thanks everyone! ill check it out

Everyone starts a noob. so lets not laugh at our younger souls.
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 2nd Dec 2005 16:38
by the way. does anyone know how to connect 2 squares or dots when you are drawing becuase if you do it to fast they get spread out

Everyone starts a noob. so lets not laugh at our younger souls.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 2nd Dec 2005 20:39 Edited at: 2nd Dec 2005 20:39
Here's my algorithm of a filled circle:



In my opinion this is faster than any other filled circle-function I could find...

Or did someone already invent this one?

Immunity and Annihalation makes Immunihalation...
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Dec 2005 23:57
Yep, that's where I started from when I wrote mine ... made it faster too

@Smartguy, Use the 2D functions in Codebase - there is a MoveTo function which you use when the use first presses the mouse button to start your line, and LineTo which draws from the last point to the current point with a line. You should be able to get them working fairly easily for you.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 3rd Dec 2005 00:45
k thanks ill check it out

Everyone starts a noob. so lets not laugh at our younger souls.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Dec 2005 08:53
Weeeee, I reinvented the wheel.

Well, in this case a filled circle algorithm...

Immunity and Annihalation makes Immunihalation...
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Dec 2005 09:07 Edited at: 3rd Dec 2005 09:09
Uhm IanM, I searched your code and did some speed comparisations with mine:



Test results:
My functions:
filled_circle(320, 240, 100)
-> 0.19 ms
filled_circle2(320, 240, 100) (just coded it)
-> 0.15 ms
your function
FilledCircle(320, 240, 100)
-> 1.54 ms

Unless this isn't your fastest filled circle code ofcourse

Immunity and Annihalation makes Immunihalation...
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 27th Jan 2006 01:42
ManI (aka IanM)
how do i change your AWESOME line function to make it have boxes where i can increase the size. becuase im gonna want to increase the size of the brush

Login to post a reply

Server time is: 2024-11-27 05:42:12
Your offset time is: 2024-11-27 05:42:12