예제 #1
0
		private FormattedText CreateText(TileIndex tileIndex)
		{
			FormattedText text = new FormattedText(tileIndex.ToString(),
				CultureInfo.CurrentCulture,
				FlowDirection.LeftToRight, new Typeface("Arial"), 8, Brushes.Red);
			return text;
		}
        private void RenderToBitmapCore(TileIndex id)
        {
            rendering = true;
            var visible = GetTileBounds(id);

            Debug.WriteLine(String.Format("Visible is {0} for id={1}", visible.ToString(), id.ToString()));

            plotter.Visible = visible;
            //plotter.InvalidateVisual();

            if (!BackgroundRenderer.GetUsesBackgroundRendering(child))
            {
                // this is done to make all inside plotter to perform measure and arrange procedures
                plotter.Dispatcher.Invoke(() => { }, DispatcherPriority.Input);
                RenderTargetBitmap bmp = new RenderTargetBitmap((int)tileSize.Width, (int)tileSize.Height, 96, 96, PixelFormats.Pbgra32);
                bmp.Render(plotter);
                bmp.Freeze();
                ReportSuccessAsync(null, bmp, id);
                rendering = false;
            }
        }
        private void RenderToBitmapCore(TileIndex id)
        {
            rendering = true;
            var visible = GetTileBounds(id);

            Debug.WriteLine(string.Format("Visible is {0} for id={1}", visible.ToString(), id.ToString()));

            plotter.Visible = visible;
            //plotter.InvalidateVisual();

            if (!BackgroundRenderer.GetUsesBackgroundRendering(child))
            {
                // this is done to make all inside plotter to perform measure and arrange procedures
                plotter.Dispatcher.Invoke(() => { }, DispatcherPriority.Input);
                RenderTargetBitmap bmp = new RenderTargetBitmap((int)tileSize.Width, (int)tileSize.Height, 96, 96, PixelFormats.Pbgra32);
                bmp.Render(plotter);
                bmp.Freeze();
                ReportSuccessAsync(null, bmp, id);
                rendering = false;
            }
        }