-1
如何在WPF中使用下面的代碼?在WPF中使用PrintDocument
private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
{
e.Graphics.DrawString("Name", new Font("tahoma", 10), Brushes.Black, 100, 100);
e.Graphics.DrawString("Last", new Font("tahoma", 10), Brushes.Black, 100, 120);
}
我的代碼在WINDOWSFORMAPPLICATION中使用,所以我可以在WPF中使用您的代碼? –
我認爲WPF dosnt支持'Graphics.DrawString' –
我只回答瞭如何使用您發佈的方法,這些都是system.drawing的一部分,專門用於打印。我以爲你想從你的wpf應用程序打印 –