AsyncImageAndroid.MainActivity.FetchBitmap C# (CSharp) Method

FetchBitmap() private method

private FetchBitmap ( string imagePath ) : Task
imagePath string
return Task
		async Task<Bitmap> FetchBitmap(string imagePath)
		{
			BitmapFactory.Options options = new BitmapFactory.Options ();
			options.InJustDecodeBounds = true;
			await BitmapFactory.DecodeFileAsync (imagePath, options);

			options.InSampleSize = options.OutWidth > options.OutHeight ? options.OutHeight / imageview.Height : options.OutWidth / imageview.Width;
			options.InJustDecodeBounds = false;

			Bitmap bitmap = await BitmapFactory.DecodeFileAsync (imagePath, options);
			return bitmap;
		}