From 97e45f70267d961168b77b149022b94022e0e199 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 24 Apr 2018 19:05:53 +0300 Subject: Working on reporting... --- .../ExtensionMethods/FrameworkElementExtensions.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Software/Visual_Studio/Tango.SharedUI/ExtensionMethods/FrameworkElementExtensions.cs (limited to 'Software/Visual_Studio/Tango.SharedUI/ExtensionMethods/FrameworkElementExtensions.cs') diff --git a/Software/Visual_Studio/Tango.SharedUI/ExtensionMethods/FrameworkElementExtensions.cs b/Software/Visual_Studio/Tango.SharedUI/ExtensionMethods/FrameworkElementExtensions.cs new file mode 100644 index 000000000..422b078a4 --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/ExtensionMethods/FrameworkElementExtensions.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Drawing.Imaging; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.SharedUI.Rendering; + +public static class FrameworkElementExtensions +{ + public static void RenderToFile(this FrameworkElement element, String filePath, ImageFormat format, Size renderSize, int quality) + { + RenderWindow renderer = new RenderWindow(element); + renderer.RenderToFileSynced(new Size(element.Width, element.Height), renderSize, filePath, format, quality, null); + } +} -- cgit v1.3.1