Пример #1
0
 public void Clip(Area area)
 {
     if (!disableScalling)
     {
         CContext.Rectangle(area.Start.X, area.Start.Y,
                            area.Width, area.Height);
         CContext.Clip();
     }
 }
Пример #2
0
 public void DrawCircleImage(Point center, double radius, Image image)
 {
     DrawCircle(center, radius);
     CContext.Save();
     CContext.Arc(center.X, center.Y, radius, 0, 2 * Math.PI);
     CContext.Clip();
     DrawImage(new Point(center.X - radius, center.Y - radius), radius * 2, radius * 2, image,
               ScaleMode.AspectFill, false);
     CContext.Restore();
 }
Пример #3
0
        public void ClipRoundRectangle(Point start, double width, double height, double radius)
        {
            double x, y;

            x = start.X;
            y = start.Y;

            if ((radius > height / 2) || (radius > width / 2))
            {
                radius = Math.Min(height / 2, width / 2);
            }

            CContext.MoveTo(x, y + radius);
            CContext.Arc(x + radius, y + radius, radius, Math.PI, -Math.PI / 2);
            CContext.LineTo(x + width - radius, y);
            CContext.Arc(x + width - radius, y + radius, radius, -Math.PI / 2, 0);
            CContext.LineTo(x + width, y + height - radius);
            CContext.Arc(x + width - radius, y + height - radius, radius, 0, Math.PI / 2);
            CContext.LineTo(x + radius, y + height);
            CContext.Arc(x + radius, y + height - radius, radius, Math.PI / 2, Math.PI);
            CContext.ClosePath();
            CContext.Clip();
        }
Пример #4
0
 public void ClipCircle(Point center, double radius)
 {
     CContext.Arc(center.X, center.Y, radius, 0, 2 * Math.PI);
     CContext.Clip();
 }
Пример #5
0
 public void Clip(Area area)
 {
     CContext.Rectangle(area.Start.X, area.Start.Y,
                        area.Width, area.Height);
     CContext.Clip();
 }