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.

DarkBASIC Professional Discussion / Antialaised Line Code

Author
Message
MooCat713
15
Years of Service
User Offline
Joined: 26th May 2011
Location:
Posted: 27th May 2011 21:40
I have been looking all over these forums for code to make an antialaised line in DarkBASIC Professional. My main goal for asking this is to get a commented function that I can copy and paste into my program and is ready for use. I would like the function to be like this:

and the color be in the rgb(r, g, b) return format.
Thanks in advance.
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 28th May 2011 03:22
Some code from code snippets, if you search "anti-alias", by Phaelax:


you can get the line to be colored with some creativity. Basically in the code snippet, that "f#" you see, then c=f#*255. you could do something like cred=f#*redcomponent, cgreen=f#*greencomponent, cblue=f#*bluecomponent
so is f#=0 then the color is black, and if f# is one then the color is the specified color. transparency stuff'd get more complicated though.


Tell me if there's a broken link to images in a thread I post, and I'll fix 'em.
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th May 2011 08:22
I thought I had a version that accounted for alpha values but couldn't find it. So I updated my snippet that Neuro posted. I'll need to include this into my graphics library, which currently has rounded boxes and circles which also utilize the same AA effect.



MooCat713
15
Years of Service
User Offline
Joined: 26th May 2011
Location:
Posted: 1st Jun 2011 22:10
Hey, thanks for the help. This is going to be a big support in my programming.

Login to post a reply

Server time is: 2026-07-11 19:06:11
Your offset time is: 2026-07-11 19:06:11