Example #1
0
        public Picture Snapshot(Rect bounds)
        {
            var skPictureRecorder = new PictureRecorder();
            var skCanvas          = skPictureRecorder.BeginRecording(bounds);

            OnDraw(skCanvas);
            return(skPictureRecorder.EndRecording());
        }
Example #2
0
        public override void EndPage()
        {
            var picture = PictureRecorder?.EndRecording();

            if (picture != null && CurrentPageSize.HasValue)
            {
                Pictures.Add(new PreviewerPicture(picture, CurrentPageSize.Value));
            }

            PictureRecorder?.Dispose();
            PictureRecorder = null;
        }