Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public UIImage Scale (SizeF newSize)
- {
- UIGraphics.BeginImageContext (newSize);
- var context = UIGraphics.GetCurrentContext ();
- context.TranslateCTM (0, newSize.Height);
- context.ScaleCTM (1f, -1f);
- context.DrawImage (new RectangleF (0, 0, newSize.Width, newSize.Height), CGImage);
- var scaledImage = UIGraphics.GetImageFromCurrentImageContext();
- UIGraphics.EndImageContext();
- return scaledImage;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement