سؤال

I'm trying to print the contents of a canvas with some other UI elements but having very limited success. Is there any way to construct the elements to a Grid for example instead, then print the contents rendered at a desired page size?

This was, I could get the benefit of databinding and vastly easier layout without using System.Windows.Documents.

هل كانت مفيدة؟

المحلول

Take a look at this good short article called Printing WPF window(visual) to printer and fit on a page. It shows the basics of printing in WPF, but also how to size the visual to fit the page.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top