public static UIImage ResizeRatio(UIImage img, int size) { float ratio; SizeF newSize; if (img.Size.Width > img.Size.Height) { ratio = img.Size.Height / img.Size.Width; newSize = new SizeF(size, size * ratio); } else { ratio = img.Size.Width / img.Size.Height; newSize = new SizeF(size * ratio, size); } return(UIImageEx.Scale(img, newSize)); }
public static UIImage Resize(UIImage img, float width, float height) { SizeF newSize = new SizeF(width, height); return(UIImageEx.Scale(img, newSize)); }