本文整理汇总了C#中CGContext.ConcatCTM方法的典型用法代码示例。如果您正苦于以下问题:C# CGContext.ConcatCTM方法的具体用法?C# CGContext.ConcatCTM怎么用?C# CGContext.ConcatCTM使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGContext
的用法示例。
在下文中一共展示了CGContext.ConcatCTM方法的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 ();
}
示例2: 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);
}
}
示例3: EraseStart
public void EraseStart()
{
if (drawingBoard == null)
return;
UIGraphics.BeginImageContext (drawingBoard.Size);
// erase lines
ctx = UIGraphics.GetCurrentContext ();
// Convert co-ordinate system to Cocoa's (origin in UL, not LL)
ctx.TranslateCTM (0, drawingBoard.Size.Height);
ctx.ConcatCTM (CGAffineTransform.MakeScale (1, -1));
ctx.DrawImage (new RectangleF (0, 0, drawingBoard.Size.Width, drawingBoard.Size.Height),
drawingBoard.CGImage);
}
示例4: 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();
}
}
示例5: DrawTexture
// test draw pattern
protected void DrawTexture(CGContext context)
{
var destRect = new CGRect (0,0,textureImage.Width,textureImage.Height);
context.DrawImage(destRect, textureImage.NativeCGImage);
if (wrapMode == WrapMode.TileFlipX)
{
context.ConcatCTM(CGAffineTransform.MakeScale(-1,1));
context.DrawImage(destRect, textureImage.NativeCGImage);
}
if (wrapMode == WrapMode.TileFlipY)
{
var transformY = new CGAffineTransform(1, 0, 0, -1,
textureImage.Width,
textureImage.Height);
context.ConcatCTM(transformY);
context.DrawImage(destRect, textureImage.NativeCGImage);
}
if (wrapMode == WrapMode.TileFlipXY)
{
// draw the original
var transform = new CGAffineTransform(1, 0, 0, 1,
0, textureImage.Height);
context.ConcatCTM(transform);
context.DrawImage(destRect, textureImage.NativeCGImage);
// reset the transform
context.ConcatCTM (context.GetCTM().Invert());
// draw next to original one that is flipped by x axis
transform = new CGAffineTransform(-1, 0, 0, 1,
textureImage.Width * 2, textureImage.Height);
context.ConcatCTM(transform);
context.DrawImage(destRect, textureImage.NativeCGImage);
// reset the transform
context.ConcatCTM (context.GetCTM().Invert());
// draw one that is flipped by Y axis under the oricinal
transform = new CGAffineTransform(1, 0, 0, -1,
0, textureImage.Height);
context.ConcatCTM(transform);
context.DrawImage(destRect, textureImage.NativeCGImage);
// draw the last one of the quadrant which is flipped by both the y and x axis
context.ConcatCTM (context.GetCTM().Invert());
transform = new CGAffineTransform(-1, 0, 0, -1,
textureImage.Width * 2, textureImage.Height);
context.ConcatCTM(transform);
context.DrawImage(destRect, textureImage.NativeCGImage);
}
}