コード例 #1
0
        public BitmapSize?GetOffsetFromCoordinates(MapPoint coordinates)
        {
            BitmapTile targetTile = _collection.FirstOrDefault(tile => tile.ContainsCoordinates(coordinates));

            if (targetTile == null)
            {
                return(null);
            }
            BitmapRect bounds     = GetSquareBitmapBounds(targetTile.Tile);
            BitmapSize tileOffset = targetTile.GetOffsetFromCoordinates(coordinates, _totalSize, _zoom);

            return(new BitmapSize(bounds.Left + tileOffset.Width, bounds.Top + tileOffset.Height));
            //return targetTile == null ? null : (BitmapSize?)targetTile.GetOffsetFromCoordinates(coordinates, _totalSize, _zoom);
        }
コード例 #2
0
 private bool CheckBoundsIntersect(BitmapRect bounds)
 {
     return(bounds.Top + bounds.Height >= 0 && bounds.Top <= _totalSize.Height && bounds.Left + bounds.Width >= 0 && bounds.Left <= _totalSize.Width);
 }
コード例 #3
0
ファイル: BitmapTile.cs プロジェクト: jaenudin86/TaxiOnline
 public BitmapTile(MapTile tile, BitmapRect bounds)
 {
     _tile   = tile;
     _square = tile.GetActualSquare();
     _bounds = bounds;
 }