Пример #1
0
        internal override void Draw(DrawParameter drawParameter)
        {
            base.Draw(drawParameter);
            if ((base.IsInitialized && base.IsVisible) && (!Rectangle2D.IsNullOrEmpty(ViewBounds)) && (base.Container != null))
            {
                if (GetCachedResolutions() != null)
                {
                    realResolutions = this.GetCachedResolutions();
                }
                else
                {
                    realResolutions = drawParameter.Resoluitons;
                }
                double resolution = MathUtil.GetNearest(drawParameter.Resolution, realResolutions, MinVisibleResolution, MaxVisibleResolution);

                int[] span = this.GetTileSpanWithin(ViewBounds, resolution);

                int level = -1;
                needShowTiles = NeedShowTiles(resolution, span, drawParameter.UseTransitions, out level);
                TileComparer comparer = new TileComparer();
                List<Tile> needDownload = needShowTiles.Except<Tile>(_inContainer.Values, comparer).ToList();
                if (needDownload.Count > 0)
                {
                    _queueSystem.InputTiles(uniqueLayerId, needDownload);
                }
            }
        }
Пример #2
0
 internal override void Draw(DrawParameter drawParameter)
 {
     base.Draw(drawParameter);
     if ((!ViewBounds.IsEmpty) && (base.IsVisible))
     {
         this.OnProgress(0);
         this.GetImageSource(
             delegate(ImageSource imgSrc)
             {
                 this.GetSourceCompleted(imgSrc, drawParameter.UseTransitions, ++this.requestID);
             }
         );
     }
 }
Пример #3
0
        internal override void Draw(DrawParameter drawParameter)
        {
            base.Draw(drawParameter);
            if (base.Container != null)
            {
                Rectangle2D bounds = ViewBounds;
                double num = 20.0 * Resolution;
                Rectangle2D biggerBounds = bounds.Inflate(num, num);//上下左右扩张20个像素的距离
                foreach (UIElement element in this.Children)
                {
                    if (element == null)
                    {
                        return;
                    }
                    if (!(element.GetValue(BBoxProperty) is Rectangle2D))
                    {
                        throw new ArgumentException(ExceptionStrings.BboxIsNotSet);
                    }

                    Rectangle2D rect = GetBBox(element);
                    if (rect.IntersectsWith(biggerBounds) && !base.Container.Children.Contains(element))
                    {
                        if (element is ShapeElement)
                        {
                            ShapeElement sb = element as ShapeElement;
                            sb.SetPath();
                            sb.InvalidatePath(base.Container.Resolution, base.Container.OriginX, base.Container.OriginY);
                            ElementsLayer.SetBBox(sb, sb.ClippedBounds);
                        }
                        base.Container.Children.Add(element);
                    }
                }
            }
        }
Пример #4
0
 internal virtual void Draw(DrawParameter drawParameter)
 {
     Resolution = drawParameter.Resolution;
     ViewBounds = drawParameter.ViewBounds;
     ViewSize = drawParameter.ViewSize;
     LayerOrigin = drawParameter.LayerOrigin;
 }