// test draw pattern private void DrawTexture(CGContext context) { var destRect = context.ConvertRectToUserSpace(new CGRect(0, 0, textureImage.Width, textureImage.Height)); context.ConcatCTM(textureImage.imageTransform); context.DrawImage(destRect, textureImage.NativeCGImage); context.ConcatCTM(textureImage.imageTransform.Invert()); if (wrapMode == WrapMode.TileFlipX || wrapMode == WrapMode.TileFlipXY) { context.ConcatCTM(CGAffineTransform.MakeScale(-1, 1)); context.ConcatCTM(textureImage.imageTransform); context.DrawImage(destRect, textureImage.NativeCGImage); context.ConcatCTM(textureImage.imageTransform.Invert()); } if (wrapMode == WrapMode.TileFlipY || wrapMode == WrapMode.TileFlipXY) { var transformY = new CGAffineTransform(1, 0, 0, -1, destRect.Width, destRect.Height); context.ConcatCTM(transformY); context.ConcatCTM(textureImage.imageTransform); context.DrawImage(destRect, textureImage.NativeCGImage); context.ConcatCTM(textureImage.imageTransform.Invert()); } if (wrapMode == WrapMode.TileFlipXY) { // draw the last one of the quadrant which is flipped by both the y and x axis var transform = new CGAffineTransform(-1, 0, 0, -1, destRect.Width * 2, destRect.Height); context.ConcatCTM(transform); context.ConcatCTM(textureImage.imageTransform); context.DrawImage(destRect, textureImage.NativeCGImage); context.ConcatCTM(textureImage.imageTransform.Invert()); } }