当前位置: 首页>>代码示例>>C#>>正文


C# Context.ShowPage方法代码示例

本文整理汇总了C#中Cairo.Context.ShowPage方法的典型用法代码示例。如果您正苦于以下问题:C# Context.ShowPage方法的具体用法?C# Context.ShowPage怎么用?C# Context.ShowPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cairo.Context的用法示例。


在下文中一共展示了Context.ShowPage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExportToPdf

 public static void ExportToPdf(this Report report ,string path)
 {
     using (PdfSurface pdfSurface = new PdfSurface (
         path,report.WidthWithMargins,report.HeightWithMargins)) {
         Cairo.Context cr = new Cairo.Context (pdfSurface);
         cr.Translate(report.Margin.Left,report.Margin.Top);
         ReportRenderer renderer = new ReportRenderer (){ Context = cr};
         renderer.RegisterRenderer (typeof(TextBlock), new TextBlockRenderer ());
         renderer.RegisterRenderer (typeof(Line), new LineRenderer ());
         renderer.RegisterRenderer (typeof(Image), new ImageRenderer (){ PixbufRepository = new PixbufRepository(report.ResourceRepository)});
         SectionRenderer sr = new SectionRenderer();
         renderer.RegisterRenderer(typeof(ReportHeaderSection), sr);
         renderer.RegisterRenderer(typeof(ReportFooterSection), sr);
         renderer.RegisterRenderer(typeof(DetailSection), sr);
         renderer.RegisterRenderer(typeof(PageHeaderSection), sr);
         renderer.RegisterRenderer(typeof(PageFooterSection), sr);
         MonoReports.Model.Engine.ReportEngine engine = new MonoReports.Model.Engine.ReportEngine (report,renderer);
         engine.Process ();
         for (int i = 0; i < report.Pages.Count; ++i) {
             renderer.RenderPage (report.Pages [i]);
             cr.ShowPage ();
         }
         pdfSurface.Finish ();
         (cr as IDisposable).Dispose ();
     }
 }
开发者ID:modesto,项目名称:monoreports,代码行数:26,代码来源:ReportExtensions.cs

示例2: Write

    public static void Write(string fileName)
    {
        Diagram diagram = Program.Load(fileName);
        string pdfName = System.IO.Path.ChangeExtension(fileName, "pdf");

        if(diagram != null)
        {
            try
            {
                using(PdfSurface pdfs = new PdfSurface(pdfName, 595, 842))
                {
                    using(Context cr = new Context(pdfs))
                    {
                        DiagramRenderer dr = new DiagramRenderer(cr, 0, 0, diagram);

                        cr.LineWidth = 1.0;
                        cr.Color = new Color(0.0, 0.0, 0.0);
                        dr.Render();
                        pdfs.SetSize(dr.width, dr.height);
                        dr.Draw();

                        cr.ShowPage();
                    }
                }

                Console.WriteLine("Wrote {0}", pdfName);
            }
            catch
            {
                Console.WriteLine("Error writing {0}", pdfName);
            }
        }
    }
开发者ID:jonasoster,项目名称:smul,代码行数:33,代码来源:Program.cs

示例3: Main

		public static void Main(string[] args)
		{
			// call the snippets
			Snippets snip = new Snippets();
			Surface surface = new PSSurface("snippets.ps", IMAGE_WIDTH, IMAGE_WIDTH);
			Context cr = new Context(surface);
			foreach (string snippet in Snippets.snippets)
			{
				cr.Save();
				Snippets.InvokeSnippet(snip, snippet, cr, IMAGE_WIDTH, IMAGE_HEIGHT);
				cr.ShowPage();
				cr.Restore();
			}
			surface.Finish ();
		}
开发者ID:REALTOBIZ,项目名称:mono,代码行数:15,代码来源:SnippetsPs.cs

示例4: Main

		public static void Main(string[] args)
		{
			// call the snippets
			Snippets snip = new Snippets();
			foreach (string snippet in Snippets.snippets)
			{
				string filename = "./" + snippet + ".svg";
				Surface surface = new SvgSurface(filename, IMAGE_WIDTH, IMAGE_WIDTH);
				Context cr = new Context(surface);
			
				cr.Save();
				Snippets.InvokeSnippet(snip, snippet, cr, IMAGE_WIDTH, IMAGE_HEIGHT);
				cr.ShowPage();
				cr.Restore();
				surface.Finish ();
			}
		}
开发者ID:nlhepler,项目名称:mono,代码行数:17,代码来源:SnippetsSvg.cs


注:本文中的Cairo.Context.ShowPage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。