private void DrawTile(BitmapImage bmp, Rect screenBounds, Rect visibleBounds) { MapTileUIElement element = new MapTileUIElement { Bounds = EnlargeRect(screenBounds, 1.01), Tile = bmp, Effect = CreateEffect(visibleBounds), DrawDebugBounds = this.DrawDebugBounds }; element.EndInit(); ContentPanel.Children.Add(element); }
private void DrawTile(BitmapSource bmp, Rect screenBounds, DataRect visibleBounds, Geometry clip) { // enlarges tile with reverse proportion with its size, // so that difference with enlarged and original rectangle is less than one pixel double enlargeCoeff = 1 + 1.0 / screenBounds.Width; MapTileUIElement element = new MapTileUIElement { Bounds = EnlargeRect(screenBounds, enlargeCoeff), Tile = bmp, DrawDebugBounds = this.DrawDebugBounds, Clip = clip }; // mercator shader will be used only if output bounds of this tile are less than // 2000 pixels. Otherwise this can cause enormous video memory usage. if (screenBounds.Width < maxScreenSizeWhenShaderIsUsed && screenBounds.Height < maxScreenSizeWhenShaderIsUsed) { element.Effect = CreateEffect(visibleBounds); } ContentPanel.Children.Add(element); }
private void DrawTile(BitmapSource bmp, Rect screenBounds, DataRect visibleBounds, Geometry clip) { // enlarges tile with reverse proportion with its size, // so that difference with enlarged and original rectangle is less than one pixel double enlargeCoeff = 1 + 1.0 / screenBounds.Width; MapTileUIElement element = new MapTileUIElement { Bounds = EnlargeRect(screenBounds, enlargeCoeff), Tile = bmp, DrawDebugBounds = this.DrawDebugBounds, Clip = clip }; // mercator shader will be used only if output bounds of this tile are less than // 2000 pixels. Otherwise this can cause enormous video memory usage. if (screenBounds.Width < maxScreenSizeWhenShaderIsUsed && screenBounds.Height < maxScreenSizeWhenShaderIsUsed) element.Effect = CreateEffect(visibleBounds); ContentPanel.Children.Add(element); }
private void DrawTile(BitmapImage bmp, Rect screenBounds, Rect visibleBounds) { MapTileUIElement element = new MapTileUIElement { Bounds = EnlargeRect(screenBounds, 1.01), Tile = bmp, Effect = CreateEffect(visibleBounds), DrawDebugBounds = this.DrawDebugBounds }; element.EndInit(); ContentPanel.Children.Add(element); }