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


C# CGContext.DrawPDFPage方法代码示例

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


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

示例1: DrawLayer

 public override void DrawLayer(CALayer layer, CGContext context)
 {
     context.SaveState ();
     context.SetFillColor (1.0f, 1.0f, 1.0f, 1.0f);
     context.FillRect (context.GetClipBoundingBox ());
     context.TranslateCTM (0.0f, layer.Bounds.Size.Height);
     context.ScaleCTM (1.0f, -1.0f);
     context.ConcatCTM (this.oParentController.currentPDFPage.GetDrawingTransform (CGPDFBox.Crop, layer.Bounds, 0, true));
     context.DrawPDFPage (this.oParentController.currentPDFPage);
     context.RestoreState ();
 }
开发者ID:Emasoft,项目名称:IpaziaPDFReader,代码行数:11,代码来源:TiledLayerDelegate.cs

示例2: DrawLayer

        public void DrawLayer(CALayer layer, CGContext context)
        {
            // fill with white background
            context.SetFillColor (1f, 1f, 1f, 1f);
            context.FillRect (Bounds);
            context.SaveState ();

            // flip page so we render it as it's meant to be read
            context.TranslateCTM (0f, Bounds.Height);
            context.ScaleCTM (1f, -1f);

            // scale page at the view-zoom level
            context.ScaleCTM (MyScale, MyScale);
            context.DrawPDFPage (Page);
            context.RestoreState ();
        }
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:16,代码来源:TiledPdfView.cs

示例3: DrawLayer

		public override void DrawLayer (CALayer layer, CGContext context)
		{
			// keep a copy since (a) it's a _virtual_ property and (b) it could change between filling and flipping
			RectangleF bounds = view.Bounds;
			
			// fill with white background
			context.SetFillColor (1.0f, 1.0f, 1.0f, 1.0f);
			context.FillRect (bounds);
			context.SaveState ();

			// flip page so we render it as it's meant to be read
			context.TranslateCTM (0.0f, bounds.Height);
			context.ScaleCTM (1.0f, -1.0f);
	
			// scale page at the view-zoom level
			context.ScaleCTM (view.Scale, view.Scale);
			context.DrawPDFPage (view.Page);
			context.RestoreState ();
		}
开发者ID:rojepp,项目名称:monotouch-samples,代码行数:19,代码来源:TiledPdfView.cs

示例4: Draw

        /// <summary>
        /// Draws the document page
        /// </summary>		
        private void Draw(CGContext context)
        {
            if (!PDFDocument.DocumentHasLoaded) {
                return;
            }

            // Draw page
            context.SetFillColor(1.0f, 1.0f, 1.0f, 1.0f);
            using (CGPDFPage pdfPage = PDFDocument.GetPage(mPageNumber)) {
                context.TranslateCTM(0, Bounds.Height);
                context.ScaleCTM(1.0f, -1.0f);
                context.ConcatCTM(pdfPage.GetDrawingTransform(CGPDFBox.Crop, Bounds, 0, true));
                context.SetRenderingIntent(CGColorRenderingIntent.Default);
                context.InterpolationQuality = CGInterpolationQuality.Default;
                context.DrawPDFPage(pdfPage);
            }
        }
开发者ID:xuanvu,项目名称:mTouch-PDFReader,代码行数:20,代码来源:PageContentView.cs

示例5: DrawInContext

	public override void DrawInContext (CGContext context)
	{
		// PDF page drawing expects a Lower-Left coordinate system, so we flip the coordinate system
		// before we start drawing.
		context.TranslateCTM (0, Bounds.Height);
		context.ScaleCTM (1, -1);
		
		// Grab the first PDF page
		using (CGPDFPage page = doc.GetPage (1)){
			// We're about to modify the context CTM to draw the PDF page where we want it, so save the graphics state in case we want to do more drawing
			context.SaveState ();
			
			// CGPDFPageGetDrawingTransform provides an easy way to get the transform for a PDF page. It will scale down to fit, including any
			// base rotations necessary to display the PDF page correctly.
			
			CGAffineTransform pdfTransform = page.GetDrawingTransform (CGPDFBox.Crop, Bounds, 0, true);

			// And apply the transform.
			context.ConcatCTM (pdfTransform);
			// Finally, we draw the page and restore the graphics state for further manipulations!
			context.DrawPDFPage (page);
			context.RestoreState();
		}
	}	
开发者ID:BoogieMAN2K,项目名称:monotouch-samples,代码行数:24,代码来源:ImageDrawing.cs


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