Ejemplo n.º 1
0
        public void saveInkPresenter()
        {
            Rect rect = new Rect(0, 0, 300, 300);
            RenderTargetBitmap targetBitmap = new RenderTargetBitmap((int)rect.Right, (int)rect.Bottom, 96d, 96d, PixelFormats.Default);

            ink.Measure(new Size((int)rect.Right, (int)rect.Bottom));
            ink.Arrange(new Rect(new Size((int)rect.Right, (int)rect.Bottom)));
            targetBitmap.Render(ink);
            targetBitmap.Freeze();
            PngBitmapEncoder png = new PngBitmapEncoder();

            png.Frames.Add(BitmapFrame.Create(targetBitmap));
            using (Stream stm = File.Create("test.png"))
            {
                png.Save(stm);
            }
        }