Пример #1
0
 public static XamlShapes.Path RenderRaster(IRaster raster, IStyle style, IViewport viewport)
 {
     XamlShapes.Path path = CreateRasterPath(style, raster.Data);
     path.Data = ConvertRaster(raster.GetBoundingBox(), viewport);
     MapRenderer.Animate(path, "Opacity", 0, 1, 600, (s, e) => { });
     return(path);
 }
Пример #2
0
        public static void DrawRaster(Graphics graphics, IRaster raster, IViewport viewport)
        {
            var imageAttributes = new ImageAttributes();

            var bitmap = new Bitmap(raster.Data);

            Point min = viewport.WorldToScreen(new Point(raster.GetBoundingBox().MinX, raster.GetBoundingBox().MinY));
            Point max = viewport.WorldToScreen(new Point(raster.GetBoundingBox().MaxX, raster.GetBoundingBox().MaxY));

            Rectangle destination = RoundToPixel(new RectangleF((float)min.X, (float)max.Y, (float)(max.X - min.X), (float)(min.Y - max.Y)));

            graphics.DrawImage(bitmap,
                               destination,
                               0, 0, bitmap.Width, bitmap.Height,
                               GraphicsUnit.Pixel,
                               imageAttributes);
        }
Пример #3
0
        public static XamlShapes.Path RenderRaster(IRaster raster, IStyle style, IViewport viewport)
        {
            var path = CreateRasterPath(style, raster.Data);

            path.Data = new XamlMedia.RectangleGeometry();
            PositionRaster(path, raster.GetBoundingBox(), viewport);
            return(path);
        }
Пример #4
0
        public static UIImage RenderRaster(IRaster raster, IStyle style, IViewport viewport)
        {
            var data          = NSData.FromArray(raster.Data.ToArray());
            var image         = UIImage.LoadFromData(data);
            var drawRectangle = ConvertBoundingBox(raster.GetBoundingBox(), viewport);

            image.Draw(drawRectangle);
            return(image);
        }
Пример #5
0
        public static UIImageView RenderRasterOnView(IRaster raster, IStyle style, IViewport viewport)
        {
            var tile          = new UIImageView();
            var data          = NSData.FromArray(raster.Data.ToArray());
            var image         = UIImage.LoadFromData(data);
            var drawRectangle = ConvertBoundingBox(raster.GetBoundingBox(), viewport);

            tile.Image = image;
            tile.Frame = drawRectangle;
            return(tile);
        }
Пример #6
0
        public static XamlShapes.Path RenderRaster(IRaster raster, IStyle style, IViewport viewport)
        {
            var path = CreateRasterPath(style, raster.Data);

            path.Data = new XamlMedia.RectangleGeometry();
            PositionRaster(path, raster.GetBoundingBox(), viewport);

            // path.Stroke = new XamlMedia.SolidColorBrush(XamlColors.Red);
            // path.StrokeThickness = 6;

            return(path);
        }
Пример #7
0
        public static CALayer RenderRasterOnLayer(IRaster raster, IStyle style, IViewport viewport)
        {
            var tile  = new CALayer();
            var data  = NSData.FromArray(raster.Data.ToArray());
            var image = UIImage.LoadFromData(data);
            var frame = ConvertBoundingBox(raster.GetBoundingBox(), viewport);

            tile.Frame    = frame;
            tile.Contents = image.CGImage;

            var aOpacity = new CABasicAnimation
            {
                KeyPath  = @"opacity",
                From     = new NSNumber(0.1),
                To       = new NSNumber(1.0),
                Duration = 0.6
            };

            tile.AddAnimation(aOpacity, "opacity");

            return(tile);
        }
Пример #8
0
        public static CALayer RenderRasterOnLayer(IRaster raster, IStyle style, IViewport viewport)
        {
            var tile = new CALayer();
            var data = NSData.FromArray(raster.Data.ToArray());
            var image = UIImage.LoadFromData(data);
            var frame = ConvertBoundingBox(raster.GetBoundingBox(), viewport);

            tile.Frame = frame;
            tile.Contents = image.CGImage;

            var aOpacity = new CABasicAnimation
                {
                    KeyPath = @"opacity",
                    From = new NSNumber(0.1),
                    To = new NSNumber(1.0),
                    Duration = 0.6
                };

            tile.AddAnimation(aOpacity, "opacity");

            return tile;
        }
Пример #9
0
        public static UIImageView RenderRasterOnView(IRaster raster, IStyle style, IViewport viewport)
        {
            var tile = new UIImageView();
            var data = NSData.FromArray(raster.Data.ToArray());
            var image = UIImage.LoadFromData(data);
            var drawRectangle = ConvertBoundingBox(raster.GetBoundingBox(), viewport);

            tile.Image = image;
            tile.Frame = drawRectangle;
            return tile;
        }
Пример #10
0
 public static UIImage RenderRaster(IRaster raster, IStyle style, IViewport viewport)
 {
     var data = NSData.FromArray(raster.Data.ToArray());
     var image = UIImage.LoadFromData(data);
     var drawRectangle = ConvertBoundingBox(raster.GetBoundingBox(), viewport);
     image.Draw((CGRect)drawRectangle);
     return image;
 }
Пример #11
0
        public static void DrawRaster(Graphics graphics, IRaster raster, IViewport viewport)
        {
            var imageAttributes = new ImageAttributes();

            var bitmap = new Bitmap(raster.Data);

            Point min = viewport.WorldToScreen(new Point(raster.GetBoundingBox().MinX, raster.GetBoundingBox().MinY));
            Point max = viewport.WorldToScreen(new Point(raster.GetBoundingBox().MaxX, raster.GetBoundingBox().MaxY));

            Rectangle destination = RoundToPixel(new RectangleF((float)min.X, (float)max.Y, (float)(max.X - min.X), (float)(min.Y - max.Y)));
            graphics.DrawImage(bitmap,
                destination,
                0, 0, bitmap.Width, bitmap.Height,
                GraphicsUnit.Pixel,
                imageAttributes);
        }
Пример #12
0
 public static XamlShapes.Path RenderRaster(IRaster raster, IStyle style, IViewport viewport)
 {
     XamlShapes.Path path = CreateRasterPath(style, raster.Data);
     path.Data = ConvertRaster(raster.GetBoundingBox(), viewport);
     MapRenderer.Animate(path, "Opacity", 0, 1, 600, (s, e) => { });
     return path;
 }
Пример #13
0
 public static XamlShapes.Path RenderRaster(IRaster raster, IStyle style, IViewport viewport)
 {
     var path = CreateRasterPath(style, raster.Data);
     path.Data = new XamlMedia.RectangleGeometry();
     PositionRaster(path, raster.GetBoundingBox(), viewport);
     return path;
 }
Пример #14
0
        public static XamlShapes.Path RenderRaster(IRaster raster, IStyle style, IViewport viewport)
        {
            var path = CreateRasterPath(style, raster.Data);
            path.Data = new XamlMedia.RectangleGeometry();
            PositionRaster(path, raster.GetBoundingBox(), viewport);

            // path.Stroke = new XamlMedia.SolidColorBrush(XamlColors.Red);
            // path.StrokeThickness = 6;

            return path;
        }