DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bezier curves and anti-aliasing

 
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming
View previous topic :: View next topic  
Author Message
Johnny_Bit
Moderator


Joined: 15 Jun 2003
Posts: 158

PostPosted: 13/01/05 11:23    Post subject: Bezier curves and anti-aliasing Reply with quote

1. how calculate where should be positioned points and control points in bezier curve (windows implementation), so the curve would go trouught specified list of points?

2. How to anti-alias that curve, so it would look smooth?
Back to top
View user's profile
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 61
Location: Netherlands

PostPosted: 13/01/05 11:52    Post subject: Reply with quote

As for question no.1 check out this article:

http://groups.google.nl/groups?hl=nl&lr;=&selm;=3666E4C4.6F65%40math.okstate.edu&rnum;=5

Cheers,
Stefan
Back to top
View user's profile Send e-mail
Johnny_Bit
Moderator


Joined: 15 Jun 2003
Posts: 158

PostPosted: 17/01/05 16:49    Post subject: Reply with quote

OK, got tat, bu how about this whole anti-aliasing thing?
Back to top
View user's profile
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 61
Location: Netherlands

PostPosted: 19/01/05 10:35    Post subject: Reply with quote

indeed Smile

umm, would anti-aliasing the line-pieces of the curve be enough?
Back to top
View user's profile Send e-mail
Johnny_Bit
Moderator


Joined: 15 Jun 2003
Posts: 158

PostPosted: 19/01/05 15:56    Post subject: Reply with quote

I quite don't understand...
Back to top
View user's profile
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 61
Location: Netherlands

PostPosted: 19/01/05 17:34    Post subject: Reply with quote

Here's some code I use in TExtGraph to get all the line-parts of a bézier curve:

Code:

  BeginPath(Canvas.Handle);
  PolyBezier(Canvas.Handle, points, 4);
  EndPath(Canvas.Handle);
  FlattenPath(Canvas.Handle);
  NumLine := getpath(Canvas.Handle, lpPoints, lpTypes, 0);
  setlength(lppoints, NumLine);
  setlength(lptypes, NumLine);
  GetPath(Canvas.Handle, lppoints[0], lptypes[0], NumLine);
  for i := 0 to NumLine-1 do begin
    case lpTypes[i] of
      PT_MOVETO: Canvas.MoveTo(lppoints[i].x, lppoints[i].y);
      PT_LINETO: Canvas.LineTo(lppoints[i].x, lppoints[i].y);
    end;
  end;


after this you could (in the for-loop) anti-alias all the lines...
Back to top
View user's profile Send e-mail
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group