Ejemplo n.º 1
0
        public static PageContent CreatePrintPageContentOxyPlot(Size pageSize, BithermalCaloricTabVM caloricVM, int width, int height, string header)
        {
            var page = new FixedPage {
                Width = pageSize.Width, Height = pageSize.Height
            };
            BitmapSource plotBmp30 = ImageUtility.ExportToBitmap(caloricVM.Calorigram30, width, height, OxyColors.Transparent, 96);

            StackPanel caloricPanel = new StackPanel();

            System.Windows.Controls.Image img30 = new System.Windows.Controls.Image();
            img30.Source = plotBmp30;
            caloricPanel.Children.Add(img30);
            BitmapSource plotBmp44 = ImageUtility.ExportToBitmap(caloricVM.Calorigram44, width, height, OxyColors.Transparent, 96);

            System.Windows.Controls.Image img44 = new System.Windows.Controls.Image();
            img44.Source = plotBmp44;
            caloricPanel.Children.Add(img44);
            GroupBox grpBox = new GroupBox();

            grpBox.Header  = header;
            grpBox.Content = caloricPanel;
            page.Children.Add(grpBox);
            page.Measure(pageSize);
            page.Arrange(new Rect(new Point(), pageSize));
            page.UpdateLayout();
            var firstPageContent = new PageContent();

            ((IAddChild)firstPageContent).AddChild(page);
            return(firstPageContent);
        }
Ejemplo n.º 2
0
        public static PageContent CreatePrintPageContentOxyPlot(Size pageSize, PlotModel plot, int width, int height, string header)
        {
            var page = new FixedPage {
                Width = pageSize.Width, Height = pageSize.Height
            };
            BitmapSource plotBitmapSrc = ImageUtility.ExportToBitmap(plot, width, height, OxyColors.Transparent, 96);

            System.Windows.Controls.Image img = new System.Windows.Controls.Image();
            img.Source = plotBitmapSrc;
            GroupBox grpBox = new GroupBox();

            grpBox.Header  = header;
            grpBox.Content = img;
            page.Children.Add(grpBox);
            page.Measure(pageSize);
            page.Arrange(new Rect(new Point(), pageSize));
            page.UpdateLayout();
            var firstPageContent = new PageContent();

            ((IAddChild)firstPageContent).AddChild(page);
            return(firstPageContent);
        }