Hi!
i have a picture that i will print..
BildOrginal = @"d:\MyPicture.jpg";
So far so good..
Now i have the Printer Dialog with a little problem...
Here is the Code:
private void button1_Click(object sender, RoutedEventArgs e) { // Standardprinter LocalPrintServer StdDrucker = new LocalPrintServer(); string StdDruckerName = StdDrucker.DefaultPrintQueue.FullName.ToString(); // Select Printer PrintDialog pD = new PrintDialog(); pD.PageRangeSelection = PageRangeSelection.AllPages; pD.UserPageRangeEnabled = true; Nullable<Boolean> print = pD.ShowDialog(); if (print == true) { StdDrucker.DefaultPrintQueue = pD.PrintQueue; PrintDocument pd = new PrintDocument(); pd.PrintPage += PrintPage; // pd.PrinterSettings.PrinterName. pd.Print(); } } private void PrintPage(object o, PrintPageEventArgs e) { System.Drawing.Image img = System.Drawing.Image.FromFile(BildOrginal); Point loc = new Point(100, 100); e.Graphics.DrawImage(img, 10, 10, 900, 700); }The Problem is on the point:
// pd.PrinterSettings.PrinterName....
How can I set the printer that i become from the printer dialog?
If I let the code run then the print goes to the Standard printer...
Best Regards
Bernd