Exemple #1
0
        public void OnActivated(DeviceDescription description)
        {
            var rectangle = new Rectangle(0, 0, _mapper.Height, _mapper.Width);

            description.Bounds     = rectangle;
            description.ClipBounds = rectangle;
        }
        public void Clip(Rectangle rectangle, DeviceDescription description)
        {
            const float epsilon = 0.10f; // A sub-pixel is close enough.
            if (Math.Abs(rectangle.Width - _mapper.Width) < epsilon && Math.Abs(rectangle.Height - _mapper.Height) < epsilon) return;

            _mapper.SetClipRegion(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
        }
Exemple #3
0
        public void Clip(Rectangle rectangle, DeviceDescription description)
        {
            const float epsilon = 0.10f; // A sub-pixel is close enough.

            if (Math.Abs(rectangle.Width - _mapper.Width) < epsilon && Math.Abs(rectangle.Height - _mapper.Height) < epsilon)
            {
                return;
            }

            _mapper.SetClipRegion(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
        }
Exemple #4
0
        public void DrawRectangle(Rectangle rectangle, GraphicsContext context, DeviceDescription description)
        {
            var svgContext = _mapper.MapGraphicsContextToSvg(new Point(rectangle.Left, rectangle.Top), context);

            AddChild(new SvgRectangle
            {
                Fill            = svgContext.Fill,
                FillOpacity     = svgContext.Opacity,
                Height          = (float)rectangle.Height,
                Stroke          = svgContext.Pen.Stroke,
                StrokeDashArray = svgContext.Pen.StrokeDashArray,
                StrokeLineCap   = svgContext.Pen.StrokeLineCap,
                StrokeLineJoin  = svgContext.Pen.StrokeLineJoin,
                StrokeWidth     = svgContext.Pen.StrokeWidth,
                Width           = (float)rectangle.Width,
                X = svgContext.Coordinate.X,
                Y = svgContext.Coordinate.Y,
            });
        }
Exemple #5
0
 public void DrawRaster(Raster raster, Rectangle destination, double rotation, bool interpolated, GraphicsContext context,
                        DeviceDescription description)
 {
     throw new NotImplementedException();
 }
 public void OnActivated(DeviceDescription description)
 {
     var rectangle = new Rectangle(0, 0, _mapper.Height, _mapper.Width);
     description.Bounds = rectangle;
     description.ClipBounds = rectangle;
 }
 public void DrawRaster(Raster raster, Rectangle destination, double rotation, bool interpolated, GraphicsContext context,
     DeviceDescription description)
 {
     throw new NotImplementedException();
 }
 public void DrawRectangle(Rectangle rectangle, GraphicsContext context, DeviceDescription description)
 {
     var svgContext = _mapper.MapGraphicsContextToSvg(new Point(rectangle.Left, rectangle.Top), context);
     AddChild(new SvgRectangle
     {
         Fill = svgContext.Fill,
         FillOpacity = svgContext.Opacity,
         Height = (float)rectangle.Height,
         Stroke = svgContext.Pen.Stroke,
         StrokeDashArray = svgContext.Pen.StrokeDashArray,
         StrokeLineCap = svgContext.Pen.StrokeLineCap,
         StrokeLineJoin = svgContext.Pen.StrokeLineJoin,
         StrokeWidth = svgContext.Pen.StrokeWidth,
         Width = (float)rectangle.Width,
         X = svgContext.Coordinate.X,
         Y = svgContext.Coordinate.Y,
     });
 }
Exemple #9
0
        private void Clip(double x0, double x1, double y0, double y1, IntPtr dd)
        {
            var rectangle = new Rectangle(Math.Min(x0, x1), Math.Min(y0, y1), Math.Abs(x0 - x1), Math.Abs(y0 - y1));

            this.device.Clip(rectangle, this.description);
        }