| View previous topic :: View next topic |
| Author |
Message |
Johnny_Bit Moderator
Joined: 15 Jun 2003 Posts: 158
|
Posted: 13/01/05 11:23 Post subject: Bezier curves and anti-aliasing |
|
|
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 |
|
 |
Stefan Junior Member
Joined: 27 Sep 2004 Posts: 61 Location: Netherlands
|
|
| Back to top |
|
 |
Johnny_Bit Moderator
Joined: 15 Jun 2003 Posts: 158
|
Posted: 17/01/05 16:49 Post subject: |
|
|
| OK, got tat, bu how about this whole anti-aliasing thing? |
|
| Back to top |
|
 |
Stefan Junior Member
Joined: 27 Sep 2004 Posts: 61 Location: Netherlands
|
Posted: 19/01/05 10:35 Post subject: |
|
|
indeed
umm, would anti-aliasing the line-pieces of the curve be enough? |
|
| Back to top |
|
 |
Johnny_Bit Moderator
Joined: 15 Jun 2003 Posts: 158
|
Posted: 19/01/05 15:56 Post subject: |
|
|
| I quite don't understand... |
|
| Back to top |
|
 |
Stefan Junior Member
Joined: 27 Sep 2004 Posts: 61 Location: Netherlands
|
Posted: 19/01/05 17:34 Post subject: |
|
|
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 |
|
 |
|