diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/ExtensionMethods/FrameworkElementExtensions.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/ExtensionMethods/FrameworkElementExtensions.cs | 18 |
1 files changed, 18 insertions, 0 deletions
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); + } +} |
