Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

How draw line with specific width


How draw line with specific width

Postby Webbi » May 29, 2009 @ 4:59pm

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?
Webbi
pm Member
 
Posts: 2
Joined: May 29, 2009 @ 4:28pm


Postby Johan » May 29, 2009 @ 9:32pm

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
Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[http://www.gapidraw.com]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


More details Johan

Postby Webbi » May 30, 2009 @ 7:24pm

Thanks Johan.
Webbi
pm Member
 
Posts: 2
Joined: May 29, 2009 @ 4:28pm


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron