Created
May 1, 2014 02:07
-
-
Save topgenorth/86af5c37d6bdc71da367 to your computer and use it in GitHub Desktop.
Draw Image on CGContext
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void DrawTargetImage(CGContext context, RectangleF rect) | |
{ | |
context.ScaleCTM(1, -1); | |
context.TranslateCTM(0, -Bounds.Height); | |
context.DrawImage(rect, _targetImage.CGImage); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
'
public override void Draw (RectangleF rect)
{
base.Draw (rect);
using (var ctxt = UIGraphics.GetCurrentContext ()) {
ctxt.SetStrokeColor (UIColor.Black.CGColor);
ctxt.ScaleCTM (1, -1);
ctxt.TranslateCTM (0, -Bounds.Height);
ctxt.AddEllipseInRect (new RectangleF (0, 0, 200, 200));
'''