Bresenham Plots

On the real studio forums there was a request for code to draw a rounded rectangle with dashes. Interesting problem. So this is my little project implementing some source code sources I found online. Source web sites given in project. The rectangle is shown in the bottom right of the screen shot. Came out nice if I do say so! I added an ellipse and antialias Wu line too. These are all drawn to a picture buffer graphics context writing to the individual pixels. Runs pretty fast!

I’m using a call to Drawline with the same x and y locations, essentially like calling a plot pixel call. This technique doesn’t seem to work on my tests with Vista. I think you need to make sure GDI is enabled, might be a bug, again, not sure. Works like butter on a Mac. :-)

Download Project Here …

 

About bigdaddytom

Hobbyist programmer, self taught, started with Rb in 1999. Xcode, Objective-C iPhone coder too. I have been blessed being able to live in Hawaii for over three decades. Proud father of two. Business owner. The above image is from atop Mauna Kea looking towards Mauna Loa on the big Island of Hawaii.
This entry was posted in Code. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>