PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

How draw line with specific width

Hi,

I new user which use GapiDraw with C# warpper.

I want to know how can I draw line with specific width?

That seems gapidraw draw line with 1 pixel width.

I can not find more example with GapiDrawNet. Where I can fine it?
Hello,

The easiest way to draw lines with variable width is as follows:

1. Implement a simple <a href="http://en.wikipedia.org/wiki/Bresenham's_line_algorithm">Bresenham</a> line algorithm in your code
2. For each coordinate, draw a circle bitmap using BltFast. Use variable circle widths for different line thickness.

This is what my students used when implementing paint programs a few years ago using GapiDraw and it worked very well. Implementing a Bresenham routine using copy/paste and calling BltFast can probably be done in less than an hour if you copy some code on the Internet.

Sincerely
Johan
Webbi · 30 May 2009, 18:24 UTC — More details Johan
Thanks Johan.