From 9ed8f5e191c3ac609bc2ca48408853a138ec0b79 Mon Sep 17 00:00:00 2001 From: RKrom Date: Wed, 18 Apr 2012 14:37:11 +0000 Subject: [PATCH] Added direct printing to the default printer git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1799 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- Greenshot/Destinations/PrinterDestination.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Greenshot/Destinations/PrinterDestination.cs b/Greenshot/Destinations/PrinterDestination.cs index 70d236d03..2357c15aa 100644 --- a/Greenshot/Destinations/PrinterDestination.cs +++ b/Greenshot/Destinations/PrinterDestination.cs @@ -88,7 +88,7 @@ namespace Greenshot.Destinations { } public override IEnumerable DynamicDestinations() { - foreach (string printer in System.Drawing.Printing.PrinterSettings.InstalledPrinters) { + foreach (string printer in PrinterSettings.InstalledPrinters) { yield return new PrinterDestination(printer); } } @@ -98,6 +98,9 @@ namespace Greenshot.Destinations { using (Image image = surface.GetImageForExport()) { if (!string.IsNullOrEmpty(printerName)) { printerSettings = new PrintHelper(image, captureDetails).PrintTo(printerName); + } else if (!manuallyInitiated) { + PrinterSettings settings = new PrinterSettings(); + printerSettings = new PrintHelper(image, captureDetails).PrintTo(settings.PrinterName); } else { printerSettings = new PrintHelper(image, captureDetails).PrintWithDialog(); }