/[dotgnu-pnet]/pnetlib/System.Drawing/Toolkit/ToolkitGraphicsBase.cs
ViewVC logotype

Diff of /pnetlib/System.Drawing/Toolkit/ToolkitGraphicsBase.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by drobosson, Fri Dec 17 12:23:20 2004 UTC revision 1.17 by drobosson, Sun Aug 28 08:14:04 2005 UTC
# Line 396  public abstract class ToolkitGraphicsBas Line 396  public abstract class ToolkitGraphicsBas
396                                  length+=Math.Sqrt((x2-x3)*(x2-x3) + (y2-y3) * (y2-y3));                                  length+=Math.Sqrt((x2-x3)*(x2-x3) + (y2-y3) * (y2-y3));
397                                  length+=Math.Sqrt((x3-x4)*(x3-x4) + (y3-y4) * (y3-y4));                                  length+=Math.Sqrt((x3-x4)*(x3-x4) + (y3-y4) * (y3-y4));
398                                                                    
399                                  return (int)Math.Ceiling(length);                return (int)Math.Ceiling(length);      
400                          }                          }
401    
402          private Point[] ComputeBezier(int x1, int y1, int x2, int y2,                    private Point[] ComputeBezier(int x1, int y1, int x2, int y2,          
# Line 465  public abstract class ToolkitGraphicsBas Line 465  public abstract class ToolkitGraphicsBas
465                          {                          {
466                                  // TODO: Optimize this to plot points without                                  // TODO: Optimize this to plot points without
467                                  // involving line-drawing operations                                  // involving line-drawing operations
468                                  Point [] points = ComputeBezier(x1,y1,x2,y2,x3,y3,x4,y4);                                  Point [] points = ComputeBezier(x1,y1,x2,y2,x3,y3,x4,y4);
469                                  if (points.Length > 2)                                  if (points.Length > 2)
470                                  {                                  {
471                                          DrawLines(points);                                          DrawLines(points);
472                                  }                                  }
473                          }                          }
474    
475    // Fill a bezier curve using the current pen.
476            public virtual void FillBezier(int x1, int y1, int x2, int y2,
477                                                                                                                                                     int x3, int y3, int x4, int y4, FillMode fillMode )
478            {
479                    // TODO: Optimize this to plot points without
480                    // involving line-drawing operations
481                    Point [] points = ComputeBezier(x1,y1,x2,y2,x3,y3,x4,y4);
482                    if (points.Length > 2)
483                    {
484                            FillPolygon(points,fillMode);
485                    }
486            }
487                            
488          // Draw a closed cardinal curve using the current pen.          // Draw a closed cardinal curve using the current pen.
489          public virtual void DrawClosedCurve(Point[] points, float tension)          public virtual void DrawClosedCurve(Point[] points, float tension)
490                          {                                                {                      

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26