Applications need to extract a part of the picture to display, the study of the night also did not get a clear miscellaneous, only recourse to Google, Xamain forum find someone to put the method posted.
Mark, please.
Reference: Http://forums.xamarin.com/discussion/4170/resize-images-and-save-thumbnails
//resize the image to be contained within a maximum width and height, keeping aspect ratio pub
Lic uiimage maxresizeimage (uiimage sourceimage, float maxwidth, float maxheight) {var sourcesize = sourceimage.size;
var maxresizefactor = Math.max (Maxwidth/sourcesize.width, maxheight/sourcesize.height);
if (Maxresizefactor > 1) return sourceimage;
var width = maxresizefactor * sourcesize.width;
var height = maxresizefactor * sourcesize.height;
Uigraphics.beginimagecontext (New SizeF (width, height));
Sourceimage.draw (New RectangleF (0, 0, width, height));
var resultimage = Uigraphics.getimagefromcurrentimagecontext ();
Uigraphics.endimagecontext ();
return resultimage; }//Resize the image (without trying to maintain aspect ratio) public uiimage resizeimage (uiimage sourceimage, float wid
Th, float height) {uigraphics.beginimagecontext (new SizeF (width, height)); Sourceimage.draw (New RectangleF (0, 0,