When we click image from camera to upload we scale down the image to 800*600 size but after uploading to server image is showing gray/currpeted
We are using below code in Xamarin.iOS to Scale the image but after uploading image to server its showing gray/blank image
`var sourceSize = sourceImage.Size;
var maxResizeFactor = Math.Min(newSize.Width / sourceSize.Width, newSize.Height / sourceSize.Height);
if (maxResizeFactor > 1) return sourceImage;
var width = maxResizeFactor * sourceSize.Width;
var height = maxResizeFactor * sourceSize.Height;
UIGraphics.BeginImageContext(new CGSize(width, height));
sourceImage.Draw(new CGRect(0, 0, width, height));
var resultImage = UIGraphics.GetImageFromCurrentImageContext();
UIGraphics.EndImageContext();
return resultImage;`
Please help us to resolve this issue
Top comments (0)