Advertisement
cansik

Untitled

Jun 17th, 2011
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. public UIImage Scale (SizeF newSize)
  2.     {
  3.         UIGraphics.BeginImageContext (newSize);
  4.         var context = UIGraphics.GetCurrentContext ();
  5.         context.TranslateCTM (0, newSize.Height);
  6.         context.ScaleCTM (1f, -1f);
  7.  
  8.         context.DrawImage (new RectangleF (0, 0, newSize.Width, newSize.Height), CGImage);
  9.  
  10.         var scaledImage = UIGraphics.GetImageFromCurrentImageContext();
  11.         UIGraphics.EndImageContext();
  12.  
  13.         return scaledImage;        
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement