Tutorial by Examples

// resize the image to be contained within a maximum width and height, keeping aspect ratio public static UIImage MaxResizeImage(this UIImage sourceImage, float maxWidth, float maxHeight) { var sourceSize = sourceImage.Size; var maxResizeFactor = Math.Min(maxWidth / sourceSize.Width, max...
// resize the image (without trying to maintain aspect ratio) public static UIImage ResizeImage(this UIImage sourceImage, float width, float height) { UIGraphics.BeginImageContext(new SizeF(width, height)); sourceImage.Draw(new RectangleF(0, 0, width, height)); var resultImage = UIG...
// crop the image, without resizing public static UIImage CropImage(this UIImage sourceImage, int crop_x, int crop_y, int width, int height) { var imgSize = sourceImage.Size; UIGraphics.BeginImageContext(new SizeF(width, height)); var context = UIGraphics.GetCurrentContext(); ...

Page 1 of 1